specutils icon indicating copy to clipboard operation
specutils copied to clipboard

Improve WCS handling when slicing/extracting regions

Open rosteen opened this issue 4 years ago • 1 comments

As of https://github.com/astropy/specutils/pull/918, slicing the spectral axis of a Spectrum1D will drop the existing WCS and recreate a fresh lookup table GWCS from the new spectral axis. It seems like it would be better to propagate any spatial components of the existing WCS for a multi-dimensional Spectrum1D. Additionally, for spatial slicing it would be nice to properly handle any spatial components of the WCS so that the resulting Spectrum1D has a WCS with as much information as the original. I'm not sure, but NDCube may handle this better than we currently do here for at least spatial dimensions - I'll have to check. It may be that we're overriding something useful.

rosteen avatar Feb 08 '22 19:02 rosteen

As referenced in https://github.com/astropy/specutils/pull/918#issuecomment-1034184624, we may want to tack onto a PR solving this something along the lines of "clearly document the WCS behavior when slicing/extracting". E.g., find some place in the narrative docs to explain the current behavior (and the fact that the "old" wcs is preserved in meta a la #918)

eteq avatar Feb 09 '22 20:02 eteq