Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moment() drops the 3rd axis [or: cubes must have a 3rd axis > 1] #367

Open
teuben opened this issue Feb 28, 2017 · 9 comments
Open

moment() drops the 3rd axis [or: cubes must have a 3rd axis > 1] #367

teuben opened this issue Feb 28, 2017 · 9 comments

Comments

@teuben
Copy link

teuben commented Feb 28, 2017

Since moment() always drops information on the 3rd axis, I cannot read the results back. Is this an intended design, or meant to be resolvable?

@keflavich
Copy link
Contributor

What information is missing? You mean the frequency axis information? I think you're right, that should be preserved in the header. Can it reasonably be put into CRPIX/CRVAL/CDELT, or will most programs misinterpret that as indicating the presence of a cube?

@teuben
Copy link
Author

teuben commented Feb 28, 2017

yes, NAXIS=2. I'd argue we could try NAXIS=3 and NAXIS3=1 and use an appropriate description for the compressed CRVAL/CDELT. Both MIRIAD and CASA do it that way. Sounds like a DtU17 hackday option.

@low-sky
Copy link
Contributor

low-sky commented Feb 28, 2017

I think there's a larger question here. Moments are 2D images and thus should they be read into spectral-cube? By default, I would say "this is working as intended. go use astropy.fits for dealing with images" However, moment0 straddle that case where you could talk about a 1 plane image with bandwidth equal to the original image. Moment1++ isn't a good fit to this 3D cubes though.

@keflavich
Copy link
Contributor

I've never been a fan of NAXIS=3 NAXIS3=1 because it is a somewhat inaccurate representation of the data; for example, optical images with wide- or narrow-band filters usually do not have any "fake" third dimension. However, I understand why you want it.

Maybe we can provide an option for writing out in "cube" or "flat" format? I would default to "flat". We'd implement this in a special-case Moment0Projection LowerDimensionalObject.

@teuben
Copy link
Author

teuben commented Feb 28, 2017

ok, that's what i needed to hear :-) moments are 2D images, not cubes (but as I said, both casa and miriad can do a little more with them since they do retain some useful compressed information).

@low-sky
Copy link
Contributor

low-sky commented Feb 28, 2017

@teuben What sort of functionality, apart from the obvious read/write, would you be looking for in SpectralCube operating on saved moments?

@e-koch
Copy link
Contributor

e-koch commented Feb 28, 2017

We already carry some meta-data along in the moments. Perhaps it can be kept there? Along with the spectral axis information, things like the spectral range used to create the moment 0 would be useful too.

@low-sky
Copy link
Contributor

low-sky commented Feb 28, 2017

I agree that it might be nice to have a LowerDimensionalObject case, mostly because the SpectralCube represents the nicest wrapper to an image-with-wcs that I have worked with. I would love to have 2D images with convolve_to and spines and other nice features that are in SpectralCube. On the other hand, I'd also like for cube[37,85,32] to give a value.

@keflavich
Copy link
Contributor

@low-sky that last issue sounds like a feature request. It's pretty implementable. Make an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants