Open gpdf opened 2 months ago
It would be relatively easy to modify AST so that alternative WCS axes that use unsupported features of FITS-WCS are ignored rather than causing the whole read operation to fail. However adding support for 2D lookup tables would be a much bigger job, which I probably couldn't offer to do.
I've just pushed some commits that adds a new attribute called IgnoreBadAlt to the FitsChan class. If you set this to a non-zero value, unreadable alternate axes will be ignored.
Excellent! I hope it'll be possible for this to get incorporated into DS9. We really appreciate the rapid response!
As far as the 2D lookup tables are concerned, I understand that it's a bigger task. I don't think we have the development effort required to tackle this ourselves before launch, but we'll take a look at it when we're in operations. We might need a few pointers on your architecture to get us started in the right spot.
The SPHEREx project is producing FITS-conformant (to the best of our knowledge) spectral WCSes for our Level 2 images (to be publicly released next year once we are on orbit) that use a two-dimensional table-lookup WCS, straight out of WCS paper III (see §6.1, https://www.aanda.org/articles/aa/full/2006/05/aa3818-05/aa3818-05.right.html#SECTION00070000000000000000) (also briefly referred to in the FITS 4.00 standard in Table 26 - algorithm code
TAB
).This is provided as "alternative WCS" 'W', in addition to a straightforward spatial WCS as the default WCS.
Currently in our testing it appears to us that DS9, because of a limitation in the included AST library, cannot handle the spectral WCS.
AST fails with this error (where the first line of the message is specific to the DS9 context):
There are two issues here:
-TAB
algorithm code in a two-dimensional context, is simply ignored (with a warning) but the parsing of the rest of the WCS succeeds? The primary WCS and WCS 'A' in this file are both perfectly usable.See also https://github.com/SAOImageDS9/SAOImageDS9/issues/201 .