healpix.core
Class Healpix

java.lang.Object
  extended byhealpix.core.Healpix

public final class Healpix
extends java.lang.Object

Java version of some healpix routines from DSRI in java everthing must be in a class - no functions floating about. Original algorithms Eric Hivon and Krzysztof M. Gorski. Healpix.core.Healpixmap does this for a fixed nside This code written by William O'Mullane


Field Summary
static int ns_max
           
static double pi
           
static double piover2
           
static double twopi
           
static double twothird
           
 
Constructor Summary
Healpix()
           
 
Method Summary
static int ang2pix_nest(int nside, double theta, double phi)
          renders the pixel number ipix (NESTED scheme) for a pixel which contains a point on a sphere at coordinates theta and phi, given the map resolution parametr nside the computation is made to the highest resolution available (nside=8192) and then degraded to that required (by integer division) this doesn't cost more, and it makes sure that the treatement of round-off will be consistent for every resolution
static int ang2pix_ring(int nside, double theta, double phi)
          renders the pixel number ipix (RING scheme) for a pixel which contains a point on a sphere at coordinates theta and phi, given the map resolution parametr nside the computation is made to the highest resolution available (nside=8192) and then degraded to that required (by integer division) this doesn't cost more, and it makes sure that the treatement of round-off will be consistent for every resolution
 int[] in_ring(int nside, int iz, double phi0, double dphi, boolean nest)
          returns the list of pixels in RING or NESTED scheme (listir); with latitude in [phi0-dphi, phi0+dphi] on the ring ir; (in {1,4*nside-1}) the pixel id-numbers are in {0,12*nside^2-1} the indexing is RING, unless NEST is set to true; ======================================================================
static double[] integration_limits_in_costh(int n_side, int i_th)
           
protected static void mkpix2xy()
          Initialize pix2x and pix2y constructs the array giving x and y in the face from pixel number for the nested (quad-cube like) ordering of pixels the bits corresponding to x and y are interleaved in the pixel number one breaks up the pixel number by even and odd bits
protected static void mkxy2pix()
          Initialize x2pix and y2pix
static int nest2ring(int nside, int ipnest)
          performs conversion from NESTED to RING pixel number
static AngularPosition pix2ang_nest(int nside, int ipix)
          Convert from pix number to angle renders theta and phi coordinates of the nominal pixel center for the pixel number ipix (NESTED scheme) given the map resolution parameter nside
static AngularPosition pix2ang_ring(int nside, int ipix)
          Convert from pix number to angle renders theta and phi coordinates of the nominal pixel center for the pixel number ipix (RING scheme) given the map resolution parameter nside
static java.awt.Point pix2xy_nest(int ipix)
          Convert from pix number to x,y inside a given face.
static java.awt.Point pix2xy_nest(int nside, int ipix)
          Convert from pix number to x,y inside a given face.
static double[] pixel_boundaries(int nside, double i_th, double i_phi, int i_zone, double cos_theta)
          calculate the points of crosing for a given theata on the boundaries of the pixel - returns the left and right phi crosings
 int[] query_disc(int nside, edu.jhu.htm.core.Vector3d vector0, double radius, boolean nest, boolean inclusive)
          =======================================================================; query_disc (Nside, Vector0, Radius, Listpix, Nlist[, Nest, Inclusive]); ----------; routine for pixel query in the RING or NESTED scheme; all pixels within an angular distance Radius of the center; Nside = resolution parameter (a power of 2); Vector0 = central point vector position (x,y,z in double precision); Radius = angular radius in RADIAN (in double precision); Listpix = list of pixel closer to the center (angular distance) than Radius; Nlist = number of pixels in the list; nest (OPT), :0 by default, the output list is in RING scheme; if set to 1, the output list is in NESTED scheme; inclusive (OPT) , :0 by default, only the pixels whose center; lie in the triangle are listed on output; if set to 1, all pixels overlapping the triangle are output; all pixel numbers are in {0, 12*Nside*Nside - 1} NB : the dimension of the listpix array is fixed in the ing; routine and should be large enough for the specific configuration; lower level public void s ed by getdisc_ring :; (you don't need to know them); ring_num (nside, ir); --------; in_ring(nside, iz, phi0, dphi, listir, nir, nest=nest); -------; v1.0, EH, TAC, ??; v1.1, EH, Caltech, Dec-2001; =======================================================================
 int ring_num(int nside, double z)
          ==================================================================== returns the ring number in {1, 4*nside-1} from the z coordinate; =====================================================================
static int ring(int nside, int ipix)
          return ring number for given pix in ring scheme
static int ring2nest(int nside, int ipring)
          performs conversion from RING to NESTED pixel number
static int xy2pix_nest(int ix, int iy)
          Convert from a x,y in a given face to a pix number in a face withour offset.
static int xy2pix_nest(int nside, int ix, int iy, int face)
          Convert from a x,y in a given face to a pix number.
static int xy2pix_nest(int nside, java.awt.Point p, int face)
          Convert from a point in a given face to a pix number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

piover2

public static final double piover2
See Also:
Constant Field Values

pi

public static final double pi
See Also:
Constant Field Values

twopi

public static final double twopi
See Also:
Constant Field Values

twothird

public static final double twothird
See Also:
Constant Field Values

ns_max

public static final int ns_max
See Also:
Constant Field Values
Constructor Detail

Healpix

public Healpix()
Method Detail

mkpix2xy

protected static void mkpix2xy()
Initialize pix2x and pix2y constructs the array giving x and y in the face from pixel number for the nested (quad-cube like) ordering of pixels the bits corresponding to x and y are interleaved in the pixel number one breaks up the pixel number by even and odd bits


mkxy2pix

protected static void mkxy2pix()
Initialize x2pix and y2pix


ang2pix_nest

public static final int ang2pix_nest(int nside,
                                     double theta,
                                     double phi)
                              throws java.lang.Exception
renders the pixel number ipix (NESTED scheme) for a pixel which contains a point on a sphere at coordinates theta and phi, given the map resolution parametr nside the computation is made to the highest resolution available (nside=8192) and then degraded to that required (by integer division) this doesn't cost more, and it makes sure that the treatement of round-off will be consistent for every resolution

Throws:
java.lang.Exception

pix2ang_nest

public static final AngularPosition pix2ang_nest(int nside,
                                                 int ipix)
                                          throws java.lang.Exception
Convert from pix number to angle renders theta and phi coordinates of the nominal pixel center for the pixel number ipix (NESTED scheme) given the map resolution parameter nside

Throws:
java.lang.Exception

pix2ang_ring

public static final AngularPosition pix2ang_ring(int nside,
                                                 int ipix)
                                          throws java.lang.Exception
Convert from pix number to angle renders theta and phi coordinates of the nominal pixel center for the pixel number ipix (RING scheme) given the map resolution parameter nside

Throws:
java.lang.Exception

ang2pix_ring

public static final int ang2pix_ring(int nside,
                                     double theta,
                                     double phi)
                              throws java.lang.Exception
renders the pixel number ipix (RING scheme) for a pixel which contains a point on a sphere at coordinates theta and phi, given the map resolution parametr nside the computation is made to the highest resolution available (nside=8192) and then degraded to that required (by integer division) this doesn't cost more, and it makes sure that the treatement of round-off will be consistent for every resolution

Throws:
java.lang.Exception

nest2ring

public static final int nest2ring(int nside,
                                  int ipnest)
                           throws java.lang.Exception
performs conversion from NESTED to RING pixel number

Throws:
java.lang.Exception

ring2nest

public static final int ring2nest(int nside,
                                  int ipring)
                           throws java.lang.Exception
performs conversion from RING to NESTED pixel number

Throws:
java.lang.Exception

pix2xy_nest

public static final java.awt.Point pix2xy_nest(int nside,
                                               int ipix)
                                        throws java.lang.Exception
Convert from pix number to x,y inside a given face. 0,0 is the lower right corner of the face.

Throws:
java.lang.Exception

xy2pix_nest

public static final int xy2pix_nest(int nside,
                                    int ix,
                                    int iy,
                                    int face)
                             throws java.lang.Exception
Convert from a x,y in a given face to a pix number.

Throws:
java.lang.Exception

xy2pix_nest

public static final int xy2pix_nest(int nside,
                                    java.awt.Point p,
                                    int face)
                             throws java.lang.Exception
Convert from a point in a given face to a pix number. Convenience method just unpacks the point to x and y and calls the other xy2pix_nest method.

Throws:
java.lang.Exception

xy2pix_nest

public static final int xy2pix_nest(int ix,
                                    int iy)
                             throws java.lang.Exception
Convert from a x,y in a given face to a pix number in a face withour offset.

Throws:
java.lang.Exception

pix2xy_nest

public static final java.awt.Point pix2xy_nest(int ipix)
                                        throws java.lang.Exception
Convert from pix number to x,y inside a given face. 0,0 is the lower right corner of the face.

Throws:
java.lang.Exception

integration_limits_in_costh

public static final double[] integration_limits_in_costh(int n_side,
                                                         int i_th)

pixel_boundaries

public static final double[] pixel_boundaries(int nside,
                                              double i_th,
                                              double i_phi,
                                              int i_zone,
                                              double cos_theta)
calculate the points of crosing for a given theata on the boundaries of the pixel - returns the left and right phi crosings


ring

public static final int ring(int nside,
                             int ipix)
                      throws java.lang.Exception
return ring number for given pix in ring scheme

Throws:
java.lang.Exception

in_ring

public int[] in_ring(int nside,
                     int iz,
                     double phi0,
                     double dphi,
                     boolean nest)
              throws java.lang.Exception
returns the list of pixels in RING or NESTED scheme (listir); with latitude in [phi0-dphi, phi0+dphi] on the ring ir; (in {1,4*nside-1}) the pixel id-numbers are in {0,12*nside^2-1} the indexing is RING, unless NEST is set to true; ======================================================================

Throws:
java.lang.Exception

query_disc

public int[] query_disc(int nside,
                        edu.jhu.htm.core.Vector3d vector0,
                        double radius,
                        boolean nest,
                        boolean inclusive)
                 throws java.lang.Exception
=======================================================================; query_disc (Nside, Vector0, Radius, Listpix, Nlist[, Nest, Inclusive]); ----------; routine for pixel query in the RING or NESTED scheme; all pixels within an angular distance Radius of the center; Nside = resolution parameter (a power of 2); Vector0 = central point vector position (x,y,z in double precision); Radius = angular radius in RADIAN (in double precision); Listpix = list of pixel closer to the center (angular distance) than Radius; Nlist = number of pixels in the list; nest (OPT), :0 by default, the output list is in RING scheme; if set to 1, the output list is in NESTED scheme; inclusive (OPT) , :0 by default, only the pixels whose center; lie in the triangle are listed on output; if set to 1, all pixels overlapping the triangle are output; all pixel numbers are in {0, 12*Nside*Nside - 1} NB : the dimension of the listpix array is fixed in the ing; routine and should be large enough for the specific configuration; lower level public void s ed by getdisc_ring :; (you don't need to know them); ring_num (nside, ir); --------; in_ring(nside, iz, phi0, dphi, listir, nir, nest=nest); -------; v1.0, EH, TAC, ??; v1.1, EH, Caltech, Dec-2001; =======================================================================

Throws:
java.lang.Exception

ring_num

public int ring_num(int nside,
                    double z)
==================================================================== returns the ring number in {1, 4*nside-1} from the z coordinate; =====================================================================