public class Area extends Object
Currently no distinction is made in this class between shapes on a 2-d plane and on the surface of a sphere; instances of this class may be interpreted in either context as required.
Modifier and Type | Class and Description |
---|---|
static class |
Area.Type
Available shape types.
|
Constructor and Description |
---|
Area(Area.Type type,
double[] dataArray)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static Area |
createMultishape(Area[] areas)
Creates a multishape area from a list of other areas.
|
static Area[] |
deserializeMultishape(double[] data)
Converts a numeric representation of a MULTISHAPE into a
list of Area instances.
|
double[] |
getDataArray()
Returns the numeric array that in conjunction with the type code
defines the coverage of this shape.
|
Area.Type |
getType()
Returns the type of this shape.
|
static double[] |
serializeMultishape(Area[] areas)
Converts a list of Area instances into its MULTISHAPE numeric array
serialization.
|
long[] |
toMocUniqs(int level)
Returns an array of UNIQ values corresponding to this shape
for a given maximum HEALPix level.
|
void |
writePlaneCoords2(double[] buffer)
Writes the characteristic (typically central) position of this area
to a buffer that can be interpreted as the positional coordinates
in the data space of a plane plot (x, y values).
|
void |
writeSkyCoords3(double[] buffer)
Writes the characteristic (typically central) position of this area
to a buffer that can be interpreted as the positional coordinates
in the data space of a sky plot (3-element unit vector).
|
public Area(Area.Type type, double[] dataArray)
type
- area shape typedataArray
- numeric array defining the actual shape of the areapublic Area.Type getType()
public double[] getDataArray()
public void writePlaneCoords2(double[] buffer)
buffer
- output array for characteristic position,
length >=2public void writeSkyCoords3(double[] buffer)
buffer
- output array for characteristic position,
length >=3public long[] toMocUniqs(int level)
level
- required HEALPix resolution levelpublic static double[] serializeMultishape(Area[] areas)
areas
- array of area instances that form the multishapeArea.Type.MULTISHAPE
public static Area[] deserializeMultishape(double[] data)
data
- array serialization of a MULTISHAPEArea.Type.MULTISHAPE
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.