Skip to content

Possible WCS bug (could be header dependent though) #1

@gully

Description

@gully

Hi there,
I found your code while looking for an existing tool to easily make postage stamp images while preserving WCS information in the header. Your imfuncs.py poststamp_radec() worked for one set of images, but when I tried it on a different image I got predicted (x,y) positions that differed from the visually confirmed ones. I traced the problem back to wcs.sky2pix(). Specifically, I compute different (x,y) values with the CodeCDF wcs and the astropy wcs.

CodeCDF

import wcs
vals = wcs.sky2pix(hdu[0].header, RA, DEC)
print vals

astropy

import astropy.units as u
from astropy.wcs import WCS

w = WCS(hdu[0].header)
x, y = w.wcs_world2pix(RA*u.degree, DEC*u.degree, 0)
print (x.tolist(), y.tolist())

I was reluctant to make an issue at first, since imfuncs worked for one image, but not another. That led me to believe that the header in my image could be malformed or at least non-standard. However, the astropy WCS manages to calculate the correct (x,y), so maybe astropy WCS has a way to catch nonstandard header information. I threw in the towel on trying to get it to work, so unfortunately I can't offer any more detail on what the root of the issue could be, and this could all be a red herring from some strange edge case. But I just wanted to give you a heads up.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions