Class Hpx
- All Implemented Interfaces:
Serializable,Component
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)
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcvtPixel(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 voiddeproj(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 projectionGet the description of this component.doubleGet the size of the HEALPix pixels in the projection frame.getName()Get the name of this component.longgetNSide()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 projectionlonggetObliquePixel(double u, double v) Given the coordinates in the normalized oblique projection, find the pixel number.longgetPixel(double[] pos) Find the pixel that includes the given position.inverse()Get the inversebooleanAre these two transformations, inverses of each other? This method is used to optimize a series of transformations where transformations.static voiddouble[]normCoords(double[] position) intnormTile(double[] norm) Return the tile number corresponding to the normalized coordinate location.static voidproj(double[] unit, double[] proj) double[]rotateAndScale(double[] position) voidsetOrder(int order) Set up the base geometry of the HEALPix projection for the given order.booleanstraddle(double[][] xy) Does this region specified by the points straddle?booleanCan 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.inttile(double[] position) Return the tile number corresponding to the nominal projection location.voidtransform(double[] sphere, double[] plane) Convert a single point where the output vector is supplied.booleanvalidPosition(double[] plane) Decide whether this is in the valid field of the HEALPix projection.Methods inherited from class skyview.geometry.Projecter
allValid, getInputDimension, getOutputDimension, getXTiling, getYTiling, shadowPoint, tissotMethods inherited from class skyview.geometry.Transformer
transform, transform
-
Constructor Details
-
Hpx
public Hpx()Default to the 512x512 squares -
Hpx
public Hpx(int order) - Parameters:
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)
-
-
Method Details
-
getHealpixScale
public double getHealpixScale()Get the size of the HEALPix pixels in the projection frame. -
setOrder
public void setOrder(int order) Set up the base geometry of the HEALPix projection for the given order.- Parameters:
order-
-
getInterleave
-
getName
Description copied from interface:ComponentGet the name of this component. -
getDescription
Description copied from interface:ComponentGet the description of this component. -
inverse
Description copied from class:ProjecterGet the inverse -
isInverse
Description copied from class:TransformerAre these two transformations, inverses of each other? This method is used to optimize a series of transformations where transformations.- Specified by:
isInversein classTransformer
-
validPosition
public boolean validPosition(double[] plane) Decide whether this is in the valid field of the HEALPix projection. This uses the geometry noted above.- Overrides:
validPositionin classProjecter- Parameters:
plane-- Returns:
-
getOblCorner
public double[] getOblCorner(long pix) Get the unscaled (i.e., unit tiles) lower left corner in the oblique projection -
getCorners
public double[][] getCorners(long pix) Get the scaled corners of a pixel in the nominal HEALPix projection -
deproj
public static void deproj(double[] in, double[] unit) Given an X-Y in the nominal HEALPix projection, return the unit vector on the sphere. -
proj
public static void proj(double[] unit, double[] proj) -
transform
public void transform(double[] sphere, double[] plane) Description copied from class:TransformerConvert a single point where the output vector is supplied.- Specified by:
transformin classTransformer- Parameters:
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.
-
getPixel
public long getPixel(double[] pos) Find the pixel that includes the given position.- Parameters:
pos- The position in the nominal HEALPix projection plane
-
getObliquePixel
public long getObliquePixel(double u, double v) Given the coordinates in the normalized oblique projection, find the pixel number. -
normCoords
public double[] normCoords(double[] position) -
denorm
public double[] denorm(double[] position) -
tile
public int tile(double[] position) Return the tile number corresponding to the nominal projection location. -
normTile
public int normTile(double[] norm) Return the tile number corresponding to the normalized coordinate location. -
rotateAndScale
public double[] rotateAndScale(double[] position) -
getNSide
public long getNSide()Get the number of pixels on each side of one of the 12 main HEALPix tiles. Note that while nSide is stored internally as a long to minimize long/int transformations, it must be in the range of an int.- Returns:
-
cvtPixel
public 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. This routine assumes that the input pixel numbers are associated with a (4 nSide)x(6 nSide) virtual image. Note that this is assumed to be in the oblique frame. -
straddleable
public boolean straddleable()Can a region straddle in the projection -- and do we have code that can address this?- Overrides:
straddleablein classProjecter
-
straddle
public boolean straddle(double[][] xy) Does this region specified by the points straddle? -
straddleComponents
public double[][][] straddleComponents(double[][] xy) Decompose a straddling region into multiple non-straddling regions.- Overrides:
straddleComponentsin classProjecter
-
main
-