Open gpdf opened 2 months ago
The remaining validation, dating back to 2012, is here:
and this is the error we're seeing.
Thanks for providing the detailed history for this item. We agree that it makes sense to ease this particular restriction on the ordering of WCSAXES keywords, and can make this change to fitsverify.
Thank you, that's great.
In June 2012 there was a discussion on FITSBITS:
https://listmgr.nrao.edu/pipermail/fitsbits/2012-June/subject.html
concerning "Primary & Alternate WCS Keyword Order".
I won't try to reproduce it in detail here. The basic idea is that the FITS standard has an unusual restriction on the
WCSAXES
keyword (FITS 4.00 §8.2) which includes the statement "This keyword, if present, must precede all WCS keywords except NAXIS in the HDU." Because FITS allows providing up to 27 different WCSes in an extension, the question arises whether this restriction should apply per WCS or across all of them -- e.g., whetherWCSAXES
must precedeCTYPE1A
and whetherWCSAXESB
must precedeCTYPE1
.Following a lengthy discussion there, Bill Pence wrote (https://listmgr.nrao.edu/pipermail/fitsbits/2012-June/002400.html):
I.e., the code requires
WCSAXES
(with no suffix letter) to precede any WCS header records for alternative WCSes.While no long-term git history for
fitsverify
is available in this repo, a comment is present memorializing this change:https://github.com/HEASARC/cfitsio/blob/3b6fc6feea25c6e8926645e06570b16f6e15cfeb/utilities/fvrf_head.c#L623-L635
There were notions in the June 2012 thread of requesting a clarification of this matter in FITS 4.00, but apparently nothing came of that.
We've just been caught by this in the FITS files we're generating for the NASA SPHEREx mission, which will release its first public data next year following its launch. For uninteresting reasons it was easier for us to put all of our WCS
A
before the primary/default WCS, meaning thatCTYPE1A
, etc., precedeWCSAXES
in our current files. While we can rearrange the headers to avoid the validation error, it seems like the consensus in the FITSBITS discussion was more supportive of the independence of WCSes from each other (as an interpretation of the current standard) and of removing the requirement altogether (in a future standard).I think changing
fitsverify
to allow the different WCSes to be independent would still be well justified.