PAHdb / pyPAHdb

A Python tool to decompose astronomical PAH emission into contributing PAH subclasses.
https://www.astrochemistry.org/pahdb/
BSD 3-Clause "New" or "Revised" License
7 stars 6 forks source link

Astropy distortion warning when running example_fits.py #24

Closed mattjshannon closed 5 years ago

mattjshannon commented 5 years ago

The specific warning is: WARNING: FITSFixedWarning: Removed redundant SCAMP distortion parameters because SIP parameters are also present [astropy.wcs.wcs] WARNING:astropy:FITSFixedWarning: Removed redundant SCAMP distortion parameters because SIP parameters are also present

It runs fine, aside from the warning. Do you receive the warning as well? Looks like we could just remove an attribute from the FITS header?

The warning came with an info dump:

INFO: Inconsistent SIP distortion information is present in the FITS header and the WCS object: SIP coefficients were detected, but CTYPE is missing a "-SIP" suffix. astropy.wcs is using the SIP distortion coefficients, therefore the coordinates calculated here might be incorrect.

            If you do not want to apply the SIP distortion coefficients,
            please remove the SIP coefficients from the FITS header or the
            WCS object.  As an example, if the image is already distortion-corrected
            (e.g., drizzled) then distortion components should not apply and the SIP
            coefficients should be removed.

            While the SIP distortion coefficients are being applied here, if that was indeed the intent,
            for consistency please append "-SIP" to the CTYPE in the FITS header or the WCS object.

             [astropy.wcs.wcs]

INFO:astropy: Inconsistent SIP distortion information is present in the FITS header and the WCS object: SIP coefficients were detected, but CTYPE is missing a "-SIP" suffix. astropy.wcs is using the SIP distortion coefficients, therefore the coordinates calculated here might be incorrect.

            If you do not want to apply the SIP distortion coefficients,
            please remove the SIP coefficients from the FITS header or the
            WCS object.  As an example, if the image is already distortion-corrected
            (e.g., drizzled) then distortion components should not apply and the SIP
            coefficients should be removed.

            While the SIP distortion coefficients are being applied here, if that was indeed the intent,
            for consistency please append "-SIP" to the CTYPE in the FITS header or the WCS object.
PAHdb commented 5 years ago

Yeah, I've seen that ... we'll need to clean up the FITS-header; simply removing everything after-and-including 'keywords from first bcd' would suffice

PAHdb commented 5 years ago

Fixed in https://github.com/PAHdb/pyPAHdb/commit/4bef73be514d1140d13c859870386c0899892784.