NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links


pix2xxx, ang2xxx, vec2xxx, nest2ring, ring2nest


These subroutines can be used to convert between pixel number in the HEALPix map and $(\theta,\phi) $ coordinates on the sphere. This is only a subset of the routines equivalent in Fortran90 or in IDL.


Location in HEALPix directory tree: src/C/subs/*.c

Note: These routines are based on the translation of the original F77 routines to C++ and then to C, by Reza Ansari (ansari@lal.in2p3.fr), Alex Kim (akim@lilys.lbl.gov), Guy Le Meur (lemeur@lal.in2p3.fr), Benoit Revenu (revenu@iap.fr) and Ken Ganga (kmg@ipac.caltech.edu).


ARGUMENTS

name & dimensionality type in/out description
       
nside long IN Nside parameter for the HEALPix map.
ipnest long -- pixel identification number in NESTED scheme over the range {0,Npix-1}.
ipring long -- pixel identification number in RING scheme over the range {0,Npix-1}.
theta double -- colatitude in radians measured southward from north pole in [0,$\pi$].
phi double -- longitude in radians, measured eastward in [0,$2\pi$].
vector double -- 3D cartesian position vector (x,y,z). The north pole is (0,0,1). An output vector is normalised to unity.

ROUTINES:
void pix2ang_ring(long nside, long ipring, double *theta, double *phi);

    renders theta and phi coordinates of the nominal pixel center given the pixel number ipring and a map resolution parameter nside.  


void pix2vec_ring(long nside, long ipring, double *vector);

    renders cartesian vector coordinates of the nominal pixel center given the pixel number ipring and a map resolution parameter nside. Optionally renders cartesian vector coordinates of the considered pixel four vertices.  


void ang2pix_ring(long nside, double theta, double phi, long *ipring);

    renders the pixel number ipring for a pixel which, given the map resolution parameter nside, contains the point on the sphere at angular coordinates theta and phi.  


void vec2pix_ring(long nside, double *vector, long *ipring);

    renders the pixel number ipring for a pixel which, given the map resolution parameter nside, contains the point on the sphere at cartesian coordinates vector.  


void pix2ang_nest(long nside, long ipnest, double *theta, double *phi);

    renders theta and phi coordinates of the nominal pixel center given the pixel number ipnest and a map resolution parameter nside.  


void pix2vec_nest(long nside, long ipnest, double *vector);

    renders cartesian vector coordinates of the nominal pixel center given the pixel number ipnest and a map resolution parameter nside. Optionally renders cartesian vector coordinates of the considered pixel four vertices.  


void ang2pix_nest(long nside, double theta, double phi, long *ipnest);

    renders the pixel number ipnest for a pixel which, given the map resolution parameter nside, contains the point on the sphere at angular coordinates theta and phi.  


void vec2pix_nest(long nside, double *vector, long *ipnest)

    renders the pixel number ipnest for a pixel which, given the map resolution parameter nside, contains the point on the sphere at cartesian coordinates vector .  


void nest2ring(long nside, long ipnest, long *ipring);

    performs conversion from NESTED to RING pixel number.  


void ring2nest(long nside, long ipring, long *ipnest);

    performs conversion from RING to NESTED pixel number.  



MODULES & ROUTINES

This section lists the modules and routines used by pix2xxx, ang2xxx, vec2xxx, nest2ring, ring2nest.

mk_pix2xy, mk_xy2pix
routines used in the conversion between pixel values and ``cartesian'' coordinates on the Healpix face.


RELATED ROUTINES

This section lists the routines related to pix2xxx, ang2xxx, vec2xxx, nest2ring, ring2nest


ang2vec
convert $(\theta,\phi) $ spherical coordinates into (x,y,z) cartesian coordinates.
vec2ang
convert (x,y,z) cartesian coordinates into $(\theta,\phi) $ spherical coordinates.

Eric Hivon 2010-06-18
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650