jwst
jwst copied to clipboard
s2d output should have a FITS WCS WAVE-TAB or other wavelength array
Currently the 2D rectified _s2d output from Spec2Pipeline is written out with a GWCS object for computing WCS. But since this is now rectified, it would be useful to represent this in FITS WCS using a WAVE-TAB.
Or if that is not useful (astropy.wcs does not currently support WAVE-TAB), at least a wavelength array written as a FITS extension, much as it is currently done in extract_2d.
Because the _s2d data are rectified, both spatially and in wavelength, couldn't the wavelengths be represented via simple FITS WCS keywords (in the SCI extension header), rather than resorting to using either a WAVE-TAB or similar 2-D wavelength array?
The wavelengths for the prism data are not linear and are not fit well by any FITS WCS function as far as I know. One could use FITS WCS keywords for spatial coordinates I think, but that is incomplete.
We could deal with the grating and prism wavelengths differently.
Since WCS-TAB is now supported at a basic level in astropy.wcs
https://github.com/astropy/astropy/pull/9641
it might be worth tackling this. Some of this work might be better done in astropy rather than in jwst, or perhaps done here and then moved upstream to astropy depending the needs in jwst and the release schedule of astropy. See
https://github.com/astropy/astropy/issues/9998
Having standard FITS WCS objects for all resampled/rectified JWST products would go a long way towards making data analysis easier on these final pipeline products.
This issue is tracked on JIRA as JP-1719.
gwcs.WCS.to_fits_tab() could be used to simplify generation of -TAB FITS WCS.
Comment by James Davies on JIRA:
Also related to
#2235
which is to update cube_build to use the same infrastructure.
This issue is tracked on JIRA as JP-1719.
Comment by James Davies [X] on JIRA:
Also related to
#2235
which is to update cube_build to use the same infrastructure.