astropy: JWST data triggers 'datfix' and 'obsfix' FITSFixedWarning
Summary
When opening the WCS of a JWST/NIRCam image, I encountering two FITSFixedWarning
warnings (see full example further below):
WARNING: FITSFixedWarning: 'datfix' made the change 'Set DATE-BEG to '2022-06-07T02:22:37.094' from MJD-BEG.
Set DATE-AVG to '2022-06-07T02:29:41.197' from MJD-AVG.
Set DATE-END to '2022-06-07T02:36:45.299' from MJD-END'. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'obsfix' made the change 'Set OBSGEO-L to -80.828196 from OBSGEO-[XYZ].
Set OBSGEO-B to -32.874352 from OBSGEO-[XYZ].
Set OBSGEO-H to 1674994226.369 from OBSGEO-[XYZ]'. [astropy.wcs.wcs]
As a user it seems surprising that brand new JWST images need fixes applied.
Is the ‘datfix’ warning desired or expected here? I note that an issue is already open related to the ‘obsfix’ warning (see https://github.com/astropy/astropy/issues/10365).
Full example
Python 3.9.7 (default, Sep 7 2021, 13:48:18)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import astropy
>>> astropy.__version__
'5.2.dev271+gfe3486171'
>>> from astropy.io import fits
>>> from astropy.wcs import WCS
>>>
>>> url = "https://stpubdata-jwst.stsci.edu/ero/jw02736/jw02736001001/jw02736001001_02101_00008_nrcblong_i2d.fits"
>>> with fits.open(url) as hdul:
... wcs = WCS(hdul["SCI"].header)
WARNING: FITSFixedWarning: 'datfix' made the change 'Set DATE-BEG to '2022-06-07T02:22:37.094' from MJD-BEG.
Set DATE-AVG to '2022-06-07T02:29:41.197' from MJD-AVG.
Set DATE-END to '2022-06-07T02:36:45.299' from MJD-END'. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'obsfix' made the change 'Set OBSGEO-L to -80.828196 from OBSGEO-[XYZ].
Set OBSGEO-B to -32.874352 from OBSGEO-[XYZ].
Set OBSGEO-H to 1674994226.369 from OBSGEO-[XYZ]'. [astropy.wcs.wcs]
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 20 (19 by maintainers)
… ~if you have a better understanding of the standards~
->
… if you are courageous enough 😄I think there is actually potentially a small astropy issue here.
From the look of those warnings, what JWST have produced is fully standard compliant, but it looks like wcslib is throwing warnings saying it’s populating alternative representations in it’s struct with the data it already has. These seem like redundant warnings?