public class Hpx extends Projecter
3
40
851
962
A7
B
Thus the 12 data squares can be enclosed in a 6x4 array including another
12 unused squares. The diagonal stripe continues where each of the three
rows repeats 01230123..., 456745674567..., 89AB89AB89AB... indefinitely
and we are free to pick the most convenient arrangement.
An alternative arrangement might be.
40
851
962
A73
B
where the data squares can be enclosed in a 5x5 array. (This
is similar to the Calabretta arrangement except that they would
repeat tile 4 below tile 3. Note that we use a bend dexter rather
than the bend sinister in Calabretta since we treat the longitude
coordinate are increasing to the right.)
The actual transformations to and from the coordinate plane are carried out using the static methods proj and deproj which are called by the relevant method of Hpx and HpxDeproj. Note that HpxDeproj is included as a static class.
HEALPix is a true transformation so this transformation function does not depend upon the input order (i.e., the number of pixels in the pixelization). This does affect ancillary functions (notably cvtPixel) which are used when individual pixels are to be considered rather than the geometric transformation between sphere and plane.
The nominal HEALPix Projection runs from 0-2 PI in x and is fully filled between 0 and +- Pi/4 in y. It has triangular teeth that extend from the filled region to Pi/2 and cover half the vertical region between PI/4 and PI/2. Thus the total area covered by the projections is 2 PI * (PI/2 + 1/2 * PI/2) A = 2 PI * 3/4 PI. In principle since this is an area conserving transformation we might expect the total area to be 4 PI. However to allow these convenient boundaries to the map the nominal project expands pixels by a factor of 3 PI/8. The nominal area of the projection is A=3 PI^2/2 A = 3 PI^2 /2. So the area of the pixels expands by a factor of 3 PI/8 relative to the area on the unit sphere. A=14.8 so we shrink the tiles slightly when we work in the oblique normalized projection where the tiles are unit squares and the total area is exactly 12.
Given that the total area is 3*PI^2/2, the area of each tile is 3*PI^2 / 24 = PI^2/8 Thus each of the tile sides is sqrt(A/12) = PI/SQRT(8) = PI/ (2 SQRT(2)) in the nominal HEALPix projection (in which the tiles are oriented as diamonds)
Modifier and Type | Class and Description |
---|---|
static class |
Hpx.HpxDeproj |
Constructor and Description |
---|
Hpx()
Default to the 512x512 squares
|
Hpx(int order) |
Modifier and Type | Method and Description |
---|---|
long |
cvtPixel(long pixel)
This method converts a pixel number based on the assumption
that we have a simple two-d image map, into the nested HEALPix
pixel number.
|
double[] |
denorm(double[] position) |
static void |
deproj(double[] in,
double[] unit)
Given an X-Y in the nominal HEALPix projection, return
the unit vector on the sphere.
|
double[][] |
getCorners(long pix)
Get the scaled corners of a pixel in the nominal HEALPix projection
|
java.lang.String |
getDescription()
Get the description of this component.
|
double |
getHealpixScale()
Get the size of the HEALPix pixels in the projection frame.
|
Interleave |
getInterleave() |
java.lang.String |
getName()
Get the name of this component.
|
long |
getNSide()
Get the number of pixels on each side of one of the 12 main HEALPix tiles.
|
double[] |
getOblCorner(long pix)
Get the unscaled (i.e., unit tiles) lower left corner in the oblique projection
|
long |
getObliquePixel(double u,
double v)
Given the coordinates in the normalized oblique
projection, find the pixel number.
|
long |
getPixel(double[] pos)
Find the pixel that includes the given position.
|
Deprojecter |
inverse()
Get the inverse
|
boolean |
isInverse(Transformer t)
Are these two transformations, inverses of each other? This
method is used to optimize a series of transformations where
transformations.
|
static void |
main(java.lang.String[] args) |
double[] |
normCoords(double[] position) |
int |
normTile(double[] norm)
Return the tile number corresponding to the normalized coordinate location.
|
static void |
proj(double[] unit,
double[] proj) |
double[] |
rotateAndScale(double[] position) |
void |
setOrder(int order)
Set up the base geometry of the HEALPix projection for the
given order.
|
boolean |
straddle(double[][] xy)
Does this region specified by the points straddle?
|
boolean |
straddleable()
Can a region straddle in the projection -- and do
we have code that can address this?
|
double[][][] |
straddleComponents(double[][] xy)
Decompose a straddling region into multiple
non-straddling regions.
|
int |
tile(double[] position)
Return the tile number corresponding to the nominal projection location.
|
void |
transform(double[] sphere,
double[] plane)
Convert a single point where the output vector is supplied.
|
boolean |
validPosition(double[] plane)
Decide whether this is in the valid field of the HEALPix projection.
|
allValid, getInputDimension, getOutputDimension, getXTiling, getYTiling, shadowPoint, tissot
transform, transform
public Hpx()
public Hpx(int order)
order
- The power of two giving the number of pixels
along an edge of a square. The total number
of pixels in the projection is 12 * Math.pow(2, 2*order)public double getHealpixScale()
public void setOrder(int order)
order
- public Interleave getInterleave()
public java.lang.String getName()
Component
public java.lang.String getDescription()
Component
public Deprojecter inverse()
Projecter
public boolean isInverse(Transformer t)
Transformer
isInverse
in class Transformer
public boolean validPosition(double[] plane)
validPosition
in class Projecter
plane
- public double[] getOblCorner(long pix)
public double[][] getCorners(long pix)
public static void deproj(double[] in, double[] unit)
public static void proj(double[] unit, double[] proj)
public void transform(double[] sphere, double[] plane)
Transformer
transform
in class Transformer
sphere
- The input vector.plane
- The output vector, it may be the same as the input
vector if the dimensionalities are the same. All
transformers are expected to work with aliased inputs and output.public long getPixel(double[] pos)
pos
- The position in the nominal HEALPix projection planepublic long getObliquePixel(double u, double v)
public double[] normCoords(double[] position)
public double[] denorm(double[] position)
public int tile(double[] position)
public int normTile(double[] norm)
public double[] rotateAndScale(double[] position)
public long getNSide()
public long cvtPixel(long pixel)
public boolean straddleable()
straddleable
in class Projecter
public boolean straddle(double[][] xy)
public double[][][] straddleComponents(double[][] xy)
straddleComponents
in class Projecter
public static void main(java.lang.String[] args)