[AstroPy] Inverting SIP distortions

Paul Kuin npkuin at gmail.com
Thu Oct 31 21:02:12 EDT 2013


I suppose the WCS you have has the right type, e.g., like:

       fh[int(ext)].header['CTYPE1']='RA---TAN-SIP'
       fh[int(ext)].header['CTYPE2']='DEC--TAN-SIP'

If so, I happen to use, to go from pixle position to ra,dec,

world = wS.all_pix2world([bore],0)[0]

did not invert, but it seems I'm using different function/method
whatever-its-called.  Any help?

Paul


On Fri, Nov 1, 2013 at 12:08 AM, Jacob Vanderplas <jakevdp at cs.washington.edu
> wrote:

> Hello,
> I'm working on a problem that requires the inversion of SIP
> corrections: that is, I have points in world coordinates that I want
> to project onto an image plane.
>
> My FITS header contains both the (A_p_q, B_p_q) coefficients for the
> forward transformation, as well as the (AP_p_q, BP_p_q) required for
> the backward transformation, according to the Shupe et al 2005
> reference.
>
> The astropy WCS object has methods sip_foc2pix() and sip_pix2foc(),
> which appeared to be what I needed, but these don't seem to actually
> invert each other. That is:
>
> >>> from astropy.wcs import WCS
> >>> wcs = WCS(header)
> >>> Xpix = [[1, 1]]
> >>> Xfoc = wcs.sip_pix2foc(Xpix, 0)
> >>> print wcs.sip_foc2pix(Xfoc, 0)
> [[ 1.2522118   1.74039233]]
>
> I would have expected this to recover the input pixels, but it's
> clearly not the case.  Is there any functionality in astropy that will
> utilize the available AP/BP coefficients in my header to perform the
> inverse SIP distortion?  Is there anything I'm doing wrong or missing
> here?
> Thanks,
>    Jake
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>



-- 

* * * * * * * * http://www.mssl.ucl.ac.uk/~npmk/ * * * *
Dr. N.P.M. Kuin      (n.kuin at ucl.ac.uk)
phone +44-(0)1483 (prefix) -204927 (work)
mobile +44(0)7806985366  skype ID: npkuin
Mullard Space Science Laboratory  – University College London  –
Holmbury St Mary – Dorking – Surrey RH5 6NT–  U.K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131101/a6e652b2/attachment.html>


More information about the AstroPy mailing list