astropy: WCS when `-SIP` is missing from `CTYPE` but SIP coefficients are present
On several occasions (the latest at #4761) there was some confusion about WCS results caused by the fact that SIP informaiton in the headers was incomplete or incorrect. astropy.wcs
looks at A_ORDER
and B_ORDER
keywords to determine if there is SIP distortion in the headers. It does not look for -SIP
suffix in CTYPE
because for a long time wcslib
did not allow CTYPE
to be longer than 8 characters.
@antonkoekemoer made 3 suggestions in #4761 to deal with cases when -SIP
is not present in CTYPE
. I’m opening this issue to discuss these and use it as a reference in the future.
- At a minimum, could astropy.wcs issue a warning in cases like this, where CTYPE is properly FITS-compliant (eg “RA—TAN”) and does not have “-SIP” appended, but there are SIP keywords in the header- - this warning would inform the user that the image may already be distortion-corrected, but that the SIP coefficients are still being used to calculate coordinates, and that this may result in potentially incorrect coordinates.
- Providing an optional parameter, when running astropy.wcs, to force SIP not to be used (ie treat the image as already distortion-corrected) even if there are SIP coefficients in the header. This optional parameter would not be active by default (ie, default behaviour would remain unchanged), but if it’s invoked by the user then this would at least enable accurate coordinates to be obtained in cases like this.
Note that neither of the above options would change the current default behaviour, but would at least alert users to this issue and provide them with a way to mitigate it.
- Modify the default behaviour to only apply SIP coefficients if the CTYPEn keywords contain “-SIP”. I would agree that any change to the default behaviour should not be considered lightly, so my preferred route for right now may be actually options (1) and (2) above; however it may help to not take this third option off the table completely, but keep it for future discussion.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 29 (26 by maintainers)
Those whom the gods wish to destroy they first make use FITS WCS. They’re having a great laugh.
(Apologies for the editorial comment. Please return to the main program.)