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/chealpix.c 


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.  


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.  


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
converts $(\theta,\phi) $ spherical coordinates into (x,y,z) cartesian coordinates.
vec2ang
converts (x,y,z) cartesian coordinates into $(\theta,\phi) $ spherical coordinates.
nside2npix
converts number of full sky pixels Npix into resolution parameter Nside
npix2nside
converts Nside into number of full sky pixels Npix.

Version 3.82, 2022-07-28