jwst icon indicating copy to clipboard operation
jwst copied to clipboard

s2d output should have a FITS WCS WAVE-TAB or other wavelength array

Open jdavies-st opened this issue 7 years ago • 6 comments

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.

jdavies-st avatar Oct 09 '18 18:10 jdavies-st

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?

hbushouse avatar Oct 10 '18 11:10 hbushouse

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.

jdavies-st avatar Oct 10 '18 14:10 jdavies-st

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.

jdavies-st avatar Jun 09 '20 18:06 jdavies-st

This issue is tracked on JIRA as JP-1719.

stscijgbot-jp avatar Sep 21 '20 18:09 stscijgbot-jp

gwcs.WCS.to_fits_tab() could be used to simplify generation of -TAB FITS WCS.

mcara avatar Dec 19 '20 21:12 mcara

Comment by James Davies on JIRA:

Also related to

#2235

which is to update cube_build to use the same infrastructure.

stscijgbot-jp avatar Jan 15 '21 16:01 stscijgbot-jp

This issue is tracked on JIRA as JP-1719.

stscijgbot-jp avatar Oct 15 '22 00:10 stscijgbot-jp

Comment by James Davies [X] on JIRA:

Also related to

#2235

which is to update cube_build to use the same infrastructure.

stscijgbot-jp avatar Oct 15 '22 00:10 stscijgbot-jp