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


healpix.core
Class Healpix

java.lang.Object
  extended by healpix.core.Healpix

public final class Healpix
extends 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 THIS IS 32 BIT - if you want 64 use HealpixIndex

Version:
$Id: Healpix.java,v 1.1.2.4 2010/02/22 14:55:50 healpix Exp $
Author:
womullan

Field Summary
static int ns_max
          The Constant ns_max.
 
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)
          integration limits in cos(theta) for a given ring i_th, i_th > 0
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 Point pix2xy_nest(int ipix)
          Convert from pix number to x,y inside a given face. 0,0 is the lower right corner of the face.
static Point pix2xy_nest(int nside, int ipix)
          Convert from pix number to x,y inside a given face. 0,0 is the lower right corner of the face.
static double[] pixel_boundaries(int nside, double i_th, double i_phi, int i_zone, double cos_theta)
          calculate the points of crossing for a given theta on the boundaries of the pixel - returns the left and right phi crossings
 int[] query_disc(int nside, SpatialVector vector0, double radius, boolean nest, boolean inclusive)
          query_disc (Nside, Vector0, Radius, Listpix, Nlist[, Nest, Inclusive]).
 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 without 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, Point p, int face)
          Convert from a point in a given face to a pix number.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ns_max

public static final int ns_max
The Constant ns_max.

See Also:
Constant Field Values
Constructor Detail

Healpix

public Healpix()
Method Detail

ang2pix_nest

public static final int ang2pix_nest(int nside,
                                     double theta,
                                     double phi)
                              throws 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

Parameters:
nside - resolution parameter
theta - angle (along meridian), in [0,Pi], theta=0 : north pole
phi - angle (along parallel), in [0,2*Pi] * @return pixel index nested
Throws:
Exception

pix2ang_nest

public static final AngularPosition pix2ang_nest(int nside,
                                                 int ipix)
                                          throws 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

Parameters:
nside - resolution parameter
ipix - index in nest scheme
Returns:
angular position
Throws:
Exception

pix2ang_ring

public static final AngularPosition pix2ang_ring(int nside,
                                                 int ipix)
                                          throws 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 *

Parameters:
nside - resolution parameter
ipix - index in ring scheme
Returns:
angular position
Throws:
Exception

ang2pix_ring

public static final int ang2pix_ring(int nside,
                                     double theta,
                                     double phi)
                              throws 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

Parameters:
nside - resolution parameter
theta - angle (along meridian), in [0,Pi], theta=0 : north pole
phi - angle (along parallel), in [0,2*Pi]
Returns:
pixel index in ring scheme
Throws:
Exception

nest2ring

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

Parameters:
nside - resolution parameter
ipnest - index in nested scheme
Returns:
index in ring scheme
Throws:
Exception

ring2nest

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

Parameters:
nside - resolution parameter
ipring - index pixel in ring scheme
Returns:
index in nest scheme
Throws:
Exception

pix2xy_nest

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

Parameters:
nside - resolution parameter
ipix - index pixel nested
Returns:
x,y Point
Throws:
Exception

xy2pix_nest

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

Parameters:
nside - resolution parameter
ix - x poisiton
iy - y position
face - face number
Returns:
index pixel nested
Throws:
Exception

xy2pix_nest

public static final int xy2pix_nest(int nside,
                                    Point p,
                                    int face)
                             throws 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.

Parameters:
nside - resolution parameter
p - x,y point object
face - face number
Returns:
index pixel nested
Throws:
Exception

xy2pix_nest

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

Parameters:
ix - x position
iy - y position
Returns:
index pixel nested
Throws:
Exception

pix2xy_nest

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

Parameters:
ipix - index nested scheme
Returns:
x,y Point
Throws:
Exception

integration_limits_in_costh

public static final double[] integration_limits_in_costh(int n_side,
                                                         int i_th)
integration limits in cos(theta) for a given ring i_th, i_th > 0

Parameters:
n_side - resolution parameter
i_th - ith ring
Returns:
limits

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 crossing for a given theta on the boundaries of the pixel - returns the left and right phi crossings

Parameters:
nside - resolution parameter
i_th - ith pixel
i_phi - phi angle
i_zone - ith zone (0,...,3), a quarter of sphere
cos_theta - theta cosinus
Returns:
the left and right phi crossings

ring

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

Parameters:
nside - resolution parameter
ipix - index pixel in ring scheme
Returns:
ring number
Throws:
Exception

in_ring

public int[] in_ring(int nside,
                     int iz,
                     double phi0,
                     double dphi,
                     boolean nest)
              throws 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

Parameters:
nside - resolution parameter
iz - ring number
phi0 - phi angle
dphi - delta phi
nest - scheme flag: nest scheme if true, ring scheme otherwise
Returns:
list of pxiel indexes in ring
Throws:
Exception

query_disc

public int[] query_disc(int nside,
                        SpatialVector vector0,
                        double radius,
                        boolean nest,
                        boolean inclusive)
                 throws 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);

Parameters:
nside - resolution parameter
vector0 - SpatialVector poitnig to disc
radius - disc radius
nest - scheme nest if true
inclusive - include disc flag
Returns:
list of index pixel contained in disc
Throws:
Exception

ring_num

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

Parameters:
nside - resoultion parameter
z - z coordinate
Returns:
ring number

"Built from revision exported"

Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650