how to properly deal with the warning about SIP and WCS
See original GitHub issueHi, I’m working on photometry extraction of HST data (drizzled), and I have this warning/info that is printed on screen each time WCS from astropy.wcs is called, as is mentioned on this page: Note about SIP and WCS
I can’t figure out if it does apply coefficients that mess up the coordinates or not. It doesn’t appear to be the case at the level of what I can visually control (ie. my coordinates do seem to appear where they’re meant to be when I plot the data).
I did check that the CTYPE’s in the header are of the form ‘RA—TAN’ and ‘DEC–TAN’, and do not contain the -SIP suffix.
My question is two-fold:
- do I have to worry about this actually having a nefarious effect on the photometries I measure?
- how can I stop the message from appearing? (I’d like to keep the script’s output as a log, and I’d rather not having this interrupting it each time WCS is called).
In the link I attached above it seems to be explained, but without giving like a complete example or making all steps/how-to explicit. It proposes to remove the SIP coefficients from the header (but I don’t find any in the header, are they called something else?) by calling
wcsobj.sip = None
but I don’t know how I must properly initiate this or what I must import, for it not to result in an error.
What do you suggest I do? Can I maybe change something directly on the header, without causing other issues? Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Note that
wcs_world2pix
applies only the core transformation (no distortions, including SIP). I don’t know if that is correct for your data. If you need the SIP transforms, then your (sky) -> (x, y) transformation will be wrong. In that case you need to useall_world2pix
instead.If your WCS header info is consistent, then
wcs_world2pix
andall_world2pix
will give the same results for a drizzled (rectified, undistorted) image.@panossk This is an
astropy
issue withWCS
objects, not aphotutils
issue.You appear to have a FITS file with an inconsistent header where you have SIP coefficients, but the CTYPES do not have the -SIP suffix. If you want to apply the SIP coefficients, simply update header CTYPES to include the -SIP suffix. If you don’t want to apply the SIP coefficients, then remove them from the header. HST SIP coefficients are
A_*
andB_*
. That will get rid of the warnings. You have to decide which is correct for your data.If you are really using a drizzled (rectified, undistorted) image, then you should not have SIP coefficients. If SIP coefficients are present then they are always applied by astropy.wcs. That means your WCS is wrong for a drizzled image. If you are using the
Sky*
-based apertures, then your photometry will also be wrong.