imaginglss.utils.wcs_tangent module

Python routines to apply world-coordinate system transformations based on the tangent-plane projection. This code is designed to be light-weight, and specialized.

The tangent-plane projection is described in http://fits.gsfc.nasa.gov/registry/tpvwcs/tpv.html and in: “Representations of celestial coordinates in FITS”, Calabretta, M. R., and Greisen, E. W., Astronomy & Astrophysics, 395, 1077-1122, 2002.

The source code in
https://code.google.com/p/esutil/source/browse/trunk/esutil/wcsutil.py
imaginglss.utils.wcs_tangent.ang2pix(coord, CD, CRPIX, CRVAL)[source]

Convert RA, DEC to x,y, with TAN transformation

Obviously PV distortion is not supported.

No checking is performed if a given RA, DEC lies outside the range.

Parameters:

coord : array_like

coord = (RA, DEC), RA and DEC (in decimal degrees, vectorized)

CD : array_like

transformation matrix (2, 2)

CRPIX : array_like

center pixel number of (x, y), compensated by offset.

CRVAL : array_like

center coordinate of (RA, DEC), in degrees.

Notes

Look up Section 5.?.? of http://www.aanda.org/articles/aa/pdf/2002/45/aah3860.pdf

The code large follows implementation at https://code.google.com/p/esutil/source/browse/trunk/esutil/wcsutil.py

imaginglss.utils.wcs_tangent.pix2ang(xy, CD, CRPIX, CRVAL)[source]

Convert x, y to RA, DEC with TAN transformation.

See ang2pix()

imaginglss.utils.wcs_tangent.ang2pix_hdr(coord, hdr, zero_offset=True)[source]

Apply forward (ra,dec)->(x,y) TAN transformation

A convenience function for calling ang2pix, with the transformations described in a dictionary in the usual FITS header style for WCS transformations.

Parameters:

coord : array_like

(ra, dec), RA and DEC (in decimal degrees, vectorized)

hdr : dict

WCS header as a dictionary

zero_offset : boolean, optional,

If True, the routine returns 0-indexed pixel coordinates (useful in Python or C) while if it is False pixels run from 1 (as in Fortran).

Returns:

xy : array_like

xy = (x, y) pixel numbers.

imaginglss.utils.wcs_tangent.pix2ang_hdr(xy, hdr, zero_offset=True)[source]

Apply backward (x,y)->(ra,dec) TAN transformation

See ang2pix_hdr()