[AstroPy] Bug in wcs_world2pix?

David Berry d.berry at jach.hawaii.edu
Fri Sep 19 10:09:44 EDT 2014


On 19 September 2014 15:01, Michael Droettboom <mdroe at stsci.edu> wrote:
> On 09/19/2014 09:13 AM, David Berry wrote:
>> On 19 September 2014 13:23, Michael Droettboom <mdroe at stsci.edu> wrote:
>>> I've brought this to Mark Calabretta's attention -- he may have an idea.
>> wcslib provides an option to switch this sort of range checking on or
>> off. With pyast, I take the attitude that the answer to the question
>> (in this case)  "what pixel has coords RA=211 Dec=-26" is "no pixel
>> has those coords", and so pyast will always return "NaN" values in
>> such circumstances. To return apparently usable values which are in
>> fact wrong is just asking for problems in my opinion.

> Yes, but the WCS range checking only happens for a TAN projection in the
> pixel-to-sphere direction.  Not sure why that is.  In this particular
> case, it's "garbage in", but "reasonable values out" from s2p, and then
> p2s can't know to complain about it.  That might be something to improve
> there.

The docs for the wcsbchk function within wcslib says that if the
"bounds" value is odd, then strict bounds checking is performed for
the spherical-to-Cartesian (s2x) transformation for a TAN projection.

David



More information about the AstroPy mailing list