[AstroPy] Bug in wcs_world2pix?

Michael Droettboom mdroe at stsci.edu
Fri Sep 19 10:01:00 EDT 2014

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 


Michael Droettboom
Science Software Branch
Space Telescope Science Institute


More information about the AstroPy mailing list