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 charstatic final intstatic final intstatic final longstatic final StringFields inherited from class cds.moc.Moc1D
biggestOrder, mocOrder, range, sysFields 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 TypeMethodDescriptionvoidadd(HealpixImpl healpix, double alpha, double delta) Add a Moc pixel (at max order) corresponding to the alpha,delta positionvoidAdd directly a SMocfinal charcDim()Return the Moc signature character (ex: 's' for SMoc, 't' for TMOC)voidclear()Reinitialisation of the MOC - data only (not the properties)clone()Clone Moc (deep copy)protected voidDeep copy.Return the complementbooleancontains(long npix) True if the npix at the deepest order is in the MOCbooleancontains(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 mocorderdoubleProvide the angular resolution (in degrees) of the SMoc (sqrt of the smallest pixel area)intget min Moc min Order.intReturn the number of values to write in FITS serializationGet the Coosys.intersection(Moc moc) Return the Intersection with another MocbooleanisIncluding(Moc moc) OperationsbooleanisIntersecting(Moc moc) final intmaxOrder()Return the deepest possible order (ex: 29 for SMoc, 61 for TMoc)final longmaxVal()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 voidreadSpecificData(InputStream in, int naxis1, int naxis2, int nbyte, cds.moc.Moc.HeaderFits header) Internal method: read FITS data according to the type of MOC.voidsetMinOrder(int minOrder) Set min Moc min Order.voidsetSpaceSys(String coosys) Set alternative Coosys.final intReturn the number of bit shifting between two consecutive orders (ex: 2 for SMoc, 1 for TMoc)intReturn 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 Stringsys()Return the default reference systemReturn the Union with another Mocprotected intWrite SMOC data -> hierarchy modeprotected intWrite 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, writeSpecificDataRangeMethods 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, writeValMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
shiftOrderin 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:
clonein classMoc- Throws:
CloneNotSupportedException
-
clone1
Deep copy. The source is this, the target is the Moc in parameter- Overrides:
clone1in 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:
sizeOfCodingin classMoc
-
getNbCoding
public int getNbCoding()Return the number of values to write in FITS serialization- Specified by:
getNbCodingin 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:
setSpaceSysin classMoc- Parameters:
coosys- alternative coosys keyword (not standardized in IVOA document)
-
getSpaceSys
Get the Coosys. See setSpaceSys()- Overrides:
getSpaceSysin classMoc
-
setMinOrder
Set min Moc min Order. The hierarchical view will be start at this order. 0 by default- Overrides:
setMinOrderin 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:
getMinOrderin 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:
isIncludingin classMoc- Throws:
Exception
-
isIntersecting
- Specified by:
isIntersectingin classMoc- Throws:
Exception
-
union
Return the Union with another Moc -
intersection
Return the Intersection with another Moc- Overrides:
intersectionin classMoc- Throws:
Exception
-
subtraction
Return the subtraction with another Moc- Overrides:
subtractionin classMoc- Throws:
Exception
-
complement
Return the complement- Overrides:
complementin 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:
readSpecificDatain 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:
writeSpecificFitsPropin classMoc- Throws:
Exception
-
writeSpecificData
Write SMOC data -> hierarchy mode- Overrides:
writeSpecificDatain classMoc- Throws:
Exception
-