public class HealpixBase extends HealpixTables
Modifier and Type | Class and Description |
---|---|
protected class |
HealpixBase.Xyf |
Modifier and Type | Field and Description |
---|---|
protected double |
fact1 |
protected double |
fact2 |
protected long |
ncap |
protected long |
nl2 |
protected long |
nl3 |
protected long |
nl4 |
protected long |
npface |
protected long |
npix |
static long |
ns_max
Maximum Nside parameter; equivalent to 2^
order_max . |
protected long |
nside
The Nside parameter.
|
protected int |
order
The order of the map; -1 when
nside is not a power of 2. |
static int |
order_max
Maximum order parameter
|
protected Scheme |
scheme
The ordering scheme.
|
ctab, facearray, jpll, jrll, swap_cycle, swaparray, utab, xoffset, yoffset
Constructor and Description |
---|
HealpixBase()
Initializes the object to Nside=1 and scheme=NESTED.
|
HealpixBase(long nside_in,
Scheme scheme_in)
Initializes the object to a user-supplied Nside and ordering scheme.
|
Modifier and Type | Method and Description |
---|---|
long |
ang2pix(Pointing ptg)
Returns the pixel which contains the supplied Pointing.
|
Vec3[] |
boundaries(long pix,
int step)
Returns a set of points along the boundary of the given pixel.
|
long |
getNpix()
Returns the total number of pixels in the pixelisation.
|
int |
getNside()
Returns the current Nside parameter.
|
int |
getOrder()
Returns the current order parameter.
|
Scheme |
getScheme()
Returns the current ordering scheme.
|
protected long |
loc2pix(healpix.essentials.Hploc loc) |
double |
maxPixrad()
Returns the maximum angular distance between a pixel center and its
corners.
|
long[] |
neighbours(long ipix)
Returns the neighboring pixels of ipix.
|
long |
nest2ring(long ipnest)
Returns ring pixel number for the supplied nested pixel number.
|
static long |
npix2Nside(long npix)
Calculates the Nside parameter from the number of pixels.
|
static long |
nside2Npix(long nside)
Calculates the number of pixels from the Nside parameter.
|
static int |
nside2order(long nside)
Calculates the map order from its Nside parameter.
|
static long |
order2Npix(int order)
Calculates the number of pixels from the order parameter.
|
Pointing |
pix2ang(long pix)
Returns the Pointing corresponding to the center of the supplied pixel.
|
protected healpix.essentials.Hploc |
pix2loc(long pix) |
long |
pix2ring(long pix)
Compute ring index from pixel number.
|
Vec3 |
pix2vec(long pix)
Returns the normalized 3-vector corresponding to the center of the
supplied pixel.
|
protected HealpixBase.Xyf |
pix2xyf(long pix) |
Zphi |
pix2zphi(long pix)
Returns the Zphi corresponding to the center of the supplied pixel.
|
RangeSet |
queryDisc(Pointing ptg,
double radius)
Returns a range set of pixels whose centers lie within a given disk.
|
RangeSet |
queryDiscInclusive(Pointing ptg,
double radius,
int fact)
Returns a range set of pixels which overlap with a given disk.
|
RangeSet |
queryPolygon(Pointing[] vertex)
Returns a range set of pixels whose centers lie within the convex
polygon defined by the
vertex array. |
RangeSet |
queryPolygonInclusive(Pointing[] vertex,
int fact)
Returns a range set of pixels that overlap with the convex
polygon defined by the
vertex array. |
RangeSet |
queryStrip(double theta1,
double theta2,
boolean inclusive)
Returns a range set of pixels whose centers lie within a given latitude
range (if
inclusive==false ), or which overlap with this range
(if inclusive==true ). |
long |
ring2nest(long ipring)
Returns nested pixel number for the supplied ring pixel number.
|
double |
ring2theta(long ring)
Returns the colatitude for the requested ring.
|
protected HealpixBase.Xyf |
ring2xyf(long pix) |
double |
ring2z(long ring)
Returns the z-coordinate (equivalent to the cosine of the colatitude)
for the requested ring.
|
void |
setNside(long nside_in)
Adjusts the object to nside_in.
|
void |
setNsideAndScheme(long nside_in,
Scheme scheme_in)
Adjusts the object to nside_in and scheme_in.
|
void |
setScheme(Scheme scheme_in)
Adjusts the object to scheme.
|
long |
vec2pix(Vec3 vec)
Returns the pixel which contains the supplied Vec3.
|
protected long |
xyf2pix(HealpixBase.Xyf xyf) |
protected long |
xyf2pix(int ix,
int iy,
int face_num) |
long |
zphi2pix(Zphi zphi)
Returns the pixel which contains the supplied Zphi.
|
public static final int order_max
public static final long ns_max
order_max
.protected int order
nside
is not a power of 2.protected long nside
protected long nl2
protected long nl3
protected long nl4
protected long npface
protected long npix
protected long ncap
protected double fact1
protected double fact2
protected Scheme scheme
public HealpixBase()
protected HealpixBase.Xyf ring2xyf(long pix)
protected HealpixBase.Xyf pix2xyf(long pix)
protected long xyf2pix(int ix, int iy, int face_num)
protected long xyf2pix(HealpixBase.Xyf xyf)
public static int nside2order(long nside) throws Exception
nside
- the Nside parameternside
; -1 if
nside
is not a power of 2.Exception
public static long npix2Nside(long npix) throws Exception
npix
- the number of pixelsException
public static long nside2Npix(long nside) throws Exception
nside
- the Nside parameterException
public static long order2Npix(int order) throws Exception
order
- the order parameterException
public void setNside(long nside_in) throws Exception
nside_in
- the new Nside parameterException
public void setNsideAndScheme(long nside_in, Scheme scheme_in) throws Exception
nside_in
- the new Nside parameterscheme_in
- the new ordering schemeException
public Scheme getScheme()
public int getNside()
public long getNpix()
public void setScheme(Scheme scheme_in) throws Exception
scheme_in
- the new ordering schemeException
public int getOrder()
public long ang2pix(Pointing ptg) throws Exception
ptg
- the requested location on the sphere.Exception
public Pointing pix2ang(long pix) throws Exception
pix
- the requested pixel number.Exception
public long vec2pix(Vec3 vec) throws Exception
vec
- the requested location on the sphere (need not be normalized).Exception
public Vec3 pix2vec(long pix) throws Exception
pix
- the requested pixel number.Exception
public long ring2nest(long ipring) throws Exception
ipring
- the requested pixel number in RING scheme.Exception
public long nest2ring(long ipnest) throws Exception
ipnest
- the requested pixel number in NESTED scheme.Exception
protected long loc2pix(healpix.essentials.Hploc loc)
public long zphi2pix(Zphi zphi)
zphi
- the requested location on the sphere.protected healpix.essentials.Hploc pix2loc(long pix)
public Zphi pix2zphi(long pix)
pix
- the requested pixel number.public long[] neighbours(long ipix) throws Exception
ipix
- the requested pixel number.Exception
public double maxPixrad()
public double ring2z(long ring)
ring
- ring index: the northernmost ring in the map has index 1;
ring indices are increasing towards the South pole.public double ring2theta(long ring)
ring
- ring index: the northernmost ring in the map has index 1;
ring indices are increasing towards the South pole.public RangeSet queryStrip(double theta1, double theta2, boolean inclusive) throws Exception
inclusive==false
), or which overlap with this range
(if inclusive==true
).The latitude range is defined as follows:
theta1<theta2
, it is the range between theta1
and theta2
theta2
, and between
theta1
and pi.Exception
public RangeSet queryDisc(Pointing ptg, double radius) throws Exception
This method is more efficient in the RING scheme.
ptg
- the angular coordinates of the disk centerradius
- the radius (in radians) of the diskException
public RangeSet queryDiscInclusive(Pointing ptg, double radius, int fact) throws Exception
This method is more efficient in the RING scheme.
This method may return some pixels which don't overlap with
the polygon at all. The higher fact
is chosen, the fewer false
positives are returned, at the cost of increased run time.
ptg
- the angular coordinates of the disk centerradius
- the radius (in radians) of the diskfact
- The overlapping test will be done at the resolution
fact*nside
. For NESTED ordering, fact
must be a power
of 2, else it can be any positive integer. A typical choice would be 4.Exception
public RangeSet queryPolygon(Pointing[] vertex) throws Exception
vertex
array. This method is more efficient in the RING scheme.
vertex
- an array containing the vertices of the requested convex
polygon.Exception
public RangeSet queryPolygonInclusive(Pointing[] vertex, int fact) throws Exception
vertex
array. This method is more efficient in the RING scheme.
This method may return some pixels which don't overlap with
the polygon at all. The higher fact
is chosen, the fewer false
positives are returned, at the cost of increased run time.
vertex
- an array containing the vertices of the requested convex
polygon.fact
- The overlapping test will be done at the resolution
fact*nside
. For NESTED ordering, fact
must be a power
of 2, else it can be any positive integer. A typical choice would be 4.Exception
public long pix2ring(long pix)
pix
- pixel numberpublic Vec3[] boundaries(long pix, int step) throws Exception