Closed pllim closed 2 years ago
If only specutils did not mess with the axis order :laughing:
One solution might be to add a model to the GWCS to reorder the axes, though @nden will have to give advice on this as I'm not familiar enough with GWCS.
Here's the relevant discussion in gwcs: https://github.com/spacetelescope/gwcs/issues/269 IIRC I ran into difficulties due to the way the HighLevelWCSAPI was defined in astropy but I don't remember the details.
@astrofrog I have a draft PR (https://github.com/glue-viz/glue-astronomy/pull/61) open to fix this but it needs more work. I'm going to tag you in some questions there in a moment.
Also might be relevant:
I am not sure what is the proper fix. I don't want to spend time hacking it only to be told it is wrong. Please advise. Thanks!
This is because when I pass
spectral_axis
intoSpectrum1D
, it creates a GWCS using https://github.com/astropy/specutils/blob/08de408d18d709a857b67e10ca2752d548eb3100/specutils/utils/wcs_utils.py#L185 and GWCS does not seem to understandswapaxes
.cc @astrofrog @rosteen
This blocks spacetelescope/jdaviz#1040
Also see spacetelescope/gwcs#397