[AstroPy] Running wcs_pix2world for all image pixels

David Berry d.berry at jach.hawaii.edu
Fri Oct 18 09:18:11 EDT 2013


On 18 October 2013 13:56, Phil Hodge <hodge at stsci.edu> wrote:

> On 10/18/2013 08:48 AM, David Berry wrote:
> > Since I have come across several SIP headers that contain badly
> > inaccurate values for the inverse polynomial, I've followed astropy's
> > lead and changed AST so that it *always* calculates it's own inverse,
> > ignoring any inverse in the header.
>
> How do you know it's the inverse transform that's wrong, rather than the
> forward transform?


That's a good question. I'm basing it on the assumption that in practice
people will probably determine the forward transformation directly, and get
the inverse from some sort of inversion of the forward transformation. So
the forward transformation is likely to be more accurate.


>  It seems to me that if the inverse transform is
> specified in the header, that's what should be used
>

I've come across several cases where the inverse transformation is not a
true inverse of the forward transformation. As in the case of Maik's
header, if you go from (x,y) to (ra,dec), and then back to (x,y) using the
inverse contained in the header, the (x,y) you end up with can be a long
way from the one you started with. Clearly such inverses are not very
helpful.

Maybe the thing to do is to do some tests on the supplied inverse, and only
replace it if it looks inaccurate.

It may be the case that the inverse in the header is only accurate over
some limited domain.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131018/e46c51f4/attachment.html>


More information about the AstroPy mailing list