public final class HealpixNestedBMOC extends java.lang.Object implements java.lang.Iterable<HealpixNestedBMOC.CurrentValueAccessor>
Modifier and Type | Class and Description |
---|---|
static interface |
HealpixNestedBMOC.CurrentValueAccessor
Provides informations on the current element of the BMOC while iterating over it.
|
static class |
HealpixNestedBMOC.Status
Tells if an element of the MOC is covered or not by a region and, if covered, it tells is
the element is partially or fully covered.
|
Modifier and Type | Method and Description |
---|---|
static long |
buildValue(int depth,
long hash,
boolean isFull,
int depthMax)
Creates a specific hash encoding the hash value at the given depth, the depth and the status
flag.
|
long |
computeDeepSize()
Returns the number of cells at depth
getDepthMax() the moc contains, i.e. |
static HealpixNestedBMOC |
createCheck(int mocDepth,
long[] mocCells)
Same a
createUnsafe(int, long[]) except that the properties (array sorted,
no duplicates, no cell included into an other one) is checked. |
static HealpixNestedBMOC |
createCheck(int mocDepth,
long[] mocCells,
int toIndex)
Same as
createCheck(int, long[]) except that not we do not use the full array. |
static HealpixNestedBMOC |
createPacking(int mocDepth,
long[] mocCells) |
static HealpixNestedBMOC |
createPacking(int mocDepth,
long[] mocCells,
int toIndex)
We assume here that the given array is ordered, that no element overlaps another one, but that
the MOC is not normalized, i.e. a large cell may be splitted in 4 sub-cell (each sub-cell
possibly splitted in its 4 sub-cells recursively).
|
static HealpixNestedBMOC |
createUnsafe(int mocDepth,
long[] mocCells)
Create a MOC considering that the given array is already a MOC: i.e. it is sorted (ASC order)
and do not contains duplicate or small cells included into larger one's.
|
static HealpixNestedBMOC |
createUnsafe(int mocDepth,
long[] mocCells,
int toIndex)
Same as
createUnsafe(int, long[]) except that not we do not use the full array. |
FlatHashIterator |
flatHashIterator()
Returns an iterator on all the cells in the BMOC at the maximum depth.
|
int |
getDepthMax()
Returns the BMOC deeper depth.
|
java.util.Iterator<HealpixNestedBMOC.CurrentValueAccessor> |
iterator() |
int |
size()
Returns the number of elements the moc contains, i.e. the number of cells at various depth.
|
HealpixNestedBMOC.Status |
statut(int depth,
long hash)
Returns the status of the given hash at the given depth
|
HealpixNestedBMOC |
toDeeperDepth(int newDepth)
Returns a new BMOC having a deeper depth.
|
HealpixNestedBMOC |
toLowerDepth(int newDepth) |
public HealpixNestedBMOC toDeeperDepth(int newDepth)
newDepth
- the depeht of the wanted new BMOCpublic HealpixNestedBMOC toLowerDepth(int newDepth)
public int size()
public long computeDeepSize()
getDepthMax()
the moc contains, i.e.
the sum for each cell of the number of cells at depth getDepthMax()
.getDepthMax()
the moc contains, i.e.
the sum for each cell of the number of cells at depth getDepthMax()
.public static HealpixNestedBMOC createUnsafe(int mocDepth, long[] mocCells)
Arrays.copy()
is you are not sure!mocDepth
- the depth of the MOCmocCells
- the array representation of the MOCpublic static HealpixNestedBMOC createUnsafe(int mocDepth, long[] mocCells, int toIndex)
createUnsafe(int, long[])
except that not we do not use the full array.mocDepth
- the depth of the MOCmocCells
- the array representation of the MOCtoIndex
- the index of the last element (exclusive) to be considered in the mocpublic static HealpixNestedBMOC createCheck(int mocDepth, long[] mocCells)
createUnsafe(int, long[])
except that the properties (array sorted,
no duplicates, no cell included into an other one) is checked.mocDepth
- the depth of the MOCmocCells
- the array representation of the MOCpublic static HealpixNestedBMOC createCheck(int mocDepth, long[] mocCells, int toIndex)
createCheck(int, long[])
except that not we do not use the full array.mocDepth
- the depth of the MOCmocCells
- the array representation of the MOCtoIndex
- the index of the last element (exclusive) to be considered in the mocpublic static HealpixNestedBMOC createPacking(int mocDepth, long[] mocCells)
public static HealpixNestedBMOC createPacking(int mocDepth, long[] mocCells, int toIndex)
mocDepth
- depth of the mocmocCells
- ordered list of cellstoIndex
- index of the last cell to be read in the given array of cellspublic int getDepthMax()
public HealpixNestedBMOC.Status statut(int depth, long hash)
depth
- depth of the hash we want the statushash
- hash for which we want the statuspublic static final long buildValue(int depth, long hash, boolean isFull, int depthMax)
depth
- depth of the hash.hash
- value of the hash.isFull
- flag telling if the cell is fully covered or not.depthMax
- maximum depth of the MOC the value will belong to.public java.util.Iterator<HealpixNestedBMOC.CurrentValueAccessor> iterator()
iterator
in interface java.lang.Iterable<HealpixNestedBMOC.CurrentValueAccessor>
public FlatHashIterator flatHashIterator()
Copyright © 2018 F.-X. Pineau, CDS, Observatoire Astronomique de Strasbourg, Universite de Strasbourg, CNRS. All Rights Reserved.