Package cds.moc
Class SMoc
java.lang.Object
cds.moc.Moc
cds.moc.Moc1D
cds.moc.SMoc
- All Implemented Interfaces:
Cloneable
,Comparable<Moc>
,Iterable<MocCell>
- Direct Known Subclasses:
HealpixMoc
The SMoc class implements the methods specific to spatial MOCs.
It is based on the HEALpix tesselation of the sphere.
See: IVOA MOC 2.0 standard => https://www.ivoa.net/documents/MOC/
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char
static final int
static final int
static final long
static final String
Fields inherited from class cds.moc.Moc1D
biggestOrder, mocOrder, range, sys
Fields inherited from class cds.moc.Moc
ASCII, cacheDeepestOrder, cacheHashCode, cacheNbCells, comment, COMPRESS_SINGLETON, CR, FITS, JSON, LOGIC_MAX, LOGIC_MIN, MASK_COMP, MAXSIZE, MAXWORD, property, RAW, unites, UNMASK_COMP, VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(HealpixImpl healpix, double alpha, double delta) Add a Moc pixel (at max order) corresponding to the alpha,delta positionvoid
Add directly a SMocfinal char
cDim()
Return the Moc signature character (ex: 's' for SMoc, 't' for TMOC)void
clear()
Reinitialisation of the MOC - data only (not the properties)clone()
Clone Moc (deep copy)protected void
Deep copy.Return the complementboolean
contains
(long npix) True if the npix at the deepest order is in the MOCboolean
contains
(HealpixImpl healpix, double alpha, double delta) Check if the spherical coord is inside the MOC.dup()
Create and instance of same class, same sys, but no data nor mocorderdouble
Provide the angular resolution (in degrees) of the SMoc (sqrt of the smallest pixel area)int
get min Moc min Order.int
Return the number of values to write in FITS serializationGet the Coosys.intersection
(Moc moc) Return the Intersection with another Mocboolean
isIncluding
(Moc moc) Operationsboolean
isIntersecting
(Moc moc) final int
maxOrder()
Return the deepest possible order (ex: 29 for SMoc, 61 for TMoc)final long
maxVal()
Return the number of values at the deepest order (ex: 2x2^29x2^29 for SMoc, 2^61 for TMoc)queryDisc
(HealpixImpl healpix, double alpha, double delta, double radius) Provide Moc pixels totally or partially inside a circleprotected void
readSpecificData
(InputStream in, int naxis1, int naxis2, int nbyte, cds.moc.Moc.HeaderFits header) Internal method: read FITS data according to the type of MOC.void
setMinOrder
(int minOrder) Set min Moc min Order.void
setSpaceSys
(String coosys) Set alternative Coosys.final int
Return the number of bit shifting between two consecutive orders (ex: 2 for SMoc, 1 for TMoc)int
Return the number of bytes used for coding each FITS value (4 for integer, 8 for long)subtraction
(Moc moc) Return the subtraction with another Mocfinal String
sys()
Return the default reference systemReturn the Union with another Mocprotected int
Write SMOC data -> hierarchy modeprotected int
Write specifical SMOC propertiesMethods inherited from class cds.moc.Moc1D
add, add, add, addToken, bufferOff, bufferOn, bufferOn, bufferSize, cellIterator, computeHierarchy, createMocByUniq, createMocByUniqUnsorted, equals, flush, getCoverage, getEnd, getMem, getMocOrder, getNbRanges, getNbValues, getStart, getSys, hashCode, isCompatible, isEmpty, isFull, isIncluding, isIntersecting, lowAscii, operation, readSpecificDataRange, readSpecificDataRange, readSpecificDataUniq, reduction, seeRangeList, setMocOrder, setRangeList, setSys, toDebug, valIterator, writeASCII, writeJSON, writeJSON, writeSpecificDataRange
Methods inherited from class cds.moc.Moc
accretion, add, codeComp, compareTo, compressRange, createMoc, createMoc, decodeComp, difference, getBourrage, getComment, getDeepestOrder, getFitsLine, getFitsLine, getMocOrder4op, getMocOrderLogic, getNbCells, getProperty, getPropertyKeys, getSpaceMoc, getSpaceOrder, getSpaceTimeMoc, getTimeMoc, getTimeOrder, getTimeSys, getUnitDisk, getUnitDisk, hpix2uniq, isCodedComp, isSpace, isTime, iterator, json2ASCII, log2, pow2, read, read, read, readASCII, readFITS, readFully, readFully, readJSON, readLong, resetCache, setMocOrderLogic, setProperty, setProperty, setSpaceOrder, setTimeOrder, setTimeSys, toASCII, toJSON, toString, uncompressRange, uncompressRange, uniq2hpix, uniq2hpix, write, write, write, write, writeASCII, writeASCII, writeASCIIFlush, writeData, writeFITS, writeFITS, writeJSON, writeVal
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
MAXORD_S
public static final int MAXORD_S- See Also:
-
FACT_S
public static final int FACT_S- See Also:
-
DIM_S
public static final char DIM_S- See Also:
-
NBVAL_S
public static final long NBVAL_S -
SYS_S
- See Also:
-
-
Constructor Details
-
Method Details
-
maxOrder
public final int maxOrder()Return the deepest possible order (ex: 29 for SMoc, 61 for TMoc) -
shiftOrder
public final int shiftOrder()Return the number of bit shifting between two consecutive orders (ex: 2 for SMoc, 1 for TMoc)- Specified by:
shiftOrder
in classMoc1D
-
cDim
public final char cDim()Return the Moc signature character (ex: 's' for SMoc, 't' for TMOC) -
maxVal
public final long maxVal()Return the number of values at the deepest order (ex: 2x2^29x2^29 for SMoc, 2^61 for TMoc) -
sys
Return the default reference system -
clear
public void clear()Reinitialisation of the MOC - data only (not the properties) -
clone
Clone Moc (deep copy)- Specified by:
clone
in classMoc
- Throws:
CloneNotSupportedException
-
clone1
Deep copy. The source is this, the target is the Moc in parameter- Overrides:
clone1
in classMoc1D
- Throws:
CloneNotSupportedException
-
dup
Create and instance of same class, same sys, but no data nor mocorder -
sizeOfCoding
public int sizeOfCoding()Return the number of bytes used for coding each FITS value (4 for integer, 8 for long)- Specified by:
sizeOfCoding
in classMoc
-
getNbCoding
public int getNbCoding()Return the number of values to write in FITS serialization- Specified by:
getNbCoding
in classMoc
-
add
Add directly a SMoc -
add
Add a Moc pixel (at max order) corresponding to the alpha,delta position- Parameters:
alpha
- , delta position- Throws:
Exception
-
contains
Check if the spherical coord is inside the MOC. The coordinate system must be compatible with the MOC coordinate system.- Parameters:
alpha
- in degreesdelta
- in degrees- Returns:
- true if the coordinates is in one MOC pixel
- Throws:
Exception
-
queryDisc
public SMoc queryDisc(HealpixImpl healpix, double alpha, double delta, double radius) throws Exception Provide Moc pixels totally or partially inside a circle- Parameters:
alpha
- circle center (in degrees)delta
- circle center (in degrees)radius
- circle radius (in degrees)- Returns:
- an HealpixMox containing the list of pixels
- Throws:
Exception
-
setSpaceSys
Set alternative Coosys. All celestial SMoc must be expressed in ICRS (see IVOA MOC 2.0) but alternative is possible for other sphere coverage notably the planets- Overrides:
setSpaceSys
in classMoc
- Parameters:
coosys
- alternative coosys keyword (not standardized in IVOA document)
-
getSpaceSys
Get the Coosys. See setSpaceSys()- Overrides:
getSpaceSys
in classMoc
-
setMinOrder
Set min Moc min Order. The hierarchical view will be start at this order. 0 by default- Overrides:
setMinOrder
in classMoc1D
- Throws:
Exception
-
getMinOrder
public int getMinOrder()get min Moc min Order. The hierarchical view will be start at this order. 0 by default- Overrides:
getMinOrder
in classMoc1D
-
getAngularRes
public double getAngularRes()Provide the angular resolution (in degrees) of the SMoc (sqrt of the smallest pixel area) -
contains
public boolean contains(long npix) True if the npix at the deepest order is in the MOC -
isIncluding
Operations- Specified by:
isIncluding
in classMoc
- Throws:
Exception
-
isIntersecting
- Specified by:
isIntersecting
in classMoc
- Throws:
Exception
-
union
Return the Union with another Moc -
intersection
Return the Intersection with another Moc- Overrides:
intersection
in classMoc
- Throws:
Exception
-
subtraction
Return the subtraction with another Moc- Overrides:
subtraction
in classMoc
- Throws:
Exception
-
complement
Return the complement- Overrides:
complement
in classMoc1D
- Throws:
Exception
-
readSpecificData
protected void readSpecificData(InputStream in, int naxis1, int naxis2, int nbyte, cds.moc.Moc.HeaderFits header) throws Exception Internal method: read FITS data according to the type of MOC.- Specified by:
readSpecificData
in classMoc
- Parameters:
in
- The input streamnaxis1
- size of FITS row (in bytes) (generally ==nbyte, but may be 1024 for buffering)naxis2
- number of valuesnbyte
- size of each value (in bytes)header
- HDU1 header- Throws:
Exception
-
writeSpecificFitsProp
Write specifical SMOC properties- Specified by:
writeSpecificFitsProp
in classMoc
- Throws:
Exception
-
writeSpecificData
Write SMOC data -> hierarchy mode- Overrides:
writeSpecificData
in classMoc
- Throws:
Exception
-