pix2xxx, ang2xxx, 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$}.

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 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 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 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 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, nest2ring, ring2nest.

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

Eric Hivon 2003-02-07