Package cds.moc
Class STMoc
java.lang.Object
cds.moc.Moc
cds.moc.Moc2D
cds.moc.STMoc
- All Implemented Interfaces:
Cloneable
,Comparable<Moc>
,Iterable<MocCell>
The STMoc class implements the methods specific to spatial temporal MOCs.
See: IVOA MOC 2.0 standard => https://www.ivoa.net/documents/MOC/
-
Field Summary
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
void
add
(int order, long npix, double jdmin, double jdmax) Adding one élément by spaceOrder/npix et [jdmin..jdmax]void
add
(long tmin, long tmax, long smin, long smax) void
add
(HealpixImpl healpix, double alpha, double delta, double jdmin, double jdmax) STMoc specifical methodsprotected static STMoc
Create a STMoc from any kind of MOC by adding full space or time coverage if required WARNING: it is not a copy, may share data from the original Mocvoid
clear()
Clear the MOC - data only (not the properties, nor the mocOrder)clone()
Clone Moc (deep copy)protected void
Deep copy.protected long
codeDim1
(long a) Return the complementboolean
contains
(long npix, double jd) True if the npix (deepest level) and jd date is in the STMocprotected long
decodeDim1
(long a) protected long
decodeTime
(long a) dup()
Create and instance of same class, same sys, but no data nor mocorderlong
getMem()
Return approximatively the amount of memory used for storing this MOC in RAM (in bytes)SMoc covering the whole STMOCgetSpaceMoc
(long tmin, long tmax) SMoc extraction from a temporal timeint
Get space orderGet the Coosys.double
Return maximal time in JD - -1 if emptydouble
Return minimal time in JD - -1 if emptyTMoc covering from the whole STMOCgetTimeMoc
(SMoc spaceMoc) TMoc from the intersection with the spaceMocint
Get time orderint
Get the Timesysintersection
(Moc moc) Return the Intersection with another Mocprotected boolean
isCodedDim1
(long a) protected boolean
isCodedTime
(long a) boolean
isIncluding
(Moc moc) Operationsboolean
isIntersecting
(Moc moc) protected 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.protected void
Recalculates the metrics associated with the MOC hierarchical view: the number of hierarchical cells, the deepest order used...void
setSpaceOrder
(int spaceOrder) Set space order [0..29]void
setSpaceSys
(String coosys) Set alternative Coosys.void
setTimeOrder
(int timeOrder) Set time order [0..61]void
setTimeSys
(String timesys) Set alternative Timesys.subtraction
(Moc moc) Return the subtraction with another MocReturn the Union with another Mocprotected int
Write specifical STMOC propertiesMethods inherited from class cds.moc.Moc2D
add, add, add, addToken, cDim1, cDim2, cellIterator, codeTime, computeHierarchy, equals, flush, getCoverage, getEnd1, getEnd2, getMocOrder1, getMocOrder2, getNbCoding, getNbRanges, getStart1, getStart2, hashCode, isCompatible, isEmpty, isFull, lowAscii, maxOrder1, maxOrder2, operation, readSpecificDataRange, reduction, reduction, seeRangeList, setMocOrder, setMocOrder1, setMocOrder2, setRangeList, shiftOrder1, shiftOrder2, sizeOfCoding, toDebug, writeASCII, writeJSON, writeSpecificDataRange
Methods inherited from class cds.moc.Moc
accretion, add, bufferSize, codeComp, compareTo, compressRange, createMoc, createMoc, decodeComp, difference, getBourrage, getComment, getDeepestOrder, getFitsLine, getFitsLine, getMocOrder4op, getMocOrderLogic, getNbCells, getProperty, getPropertyKeys, getSpaceTimeMoc, getUnitDisk, getUnitDisk, hpix2uniq, isCodedComp, isSpace, isTime, iterator, json2ASCII, log2, pow2, read, read, read, readASCII, readFITS, readFully, readFully, readJSON, readLong, setMocOrderLogic, setProperty, setProperty, toASCII, toJSON, toString, uncompressRange, uncompressRange, uniq2hpix, uniq2hpix, write, write, write, write, writeASCII, writeASCII, writeASCIIFlush, writeData, writeFITS, writeFITS, writeJSON, writeSpecificData, writeVal
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
STMoc
public STMoc()STMoc creator -
STMoc
STMoc creator- Parameters:
timeOrder
- MocOrder for time dimension [0..61]spaceOrder
- MocOrder for space dimension [0..29]- Throws:
Exception
-
STMoc
STMoc creator- Parameters:
s
- String containing a STMOC (ASCII, JSON)- Throws:
Exception
-
STMoc
STMoc creator- Parameters:
in
- Input stream containing a STMOC (ASCII, JSON or FITS)- Throws:
Exception
-
STMoc
STMoc creator from one TMOC and one SMOC- Parameters:
tmoc
-smoc
-- Throws:
Exception
-
-
Method Details
-
asSTMoc
Create a STMoc from any kind of MOC by adding full space or time coverage if required WARNING: it is not a copy, may share data from the original Moc- Throws:
Exception
-
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 classMoc2D
- Throws:
CloneNotSupportedException
-
dup
Create and instance of same class, same sys, but no data nor mocorder -
clear
public void clear()Clear the MOC - data only (not the properties, nor the mocOrder) -
resetCache
protected void resetCache()Description copied from class:Moc
Recalculates the metrics associated with the MOC hierarchical view: the number of hierarchical cells, the deepest order used...- Overrides:
resetCache
in classMoc
-
getMem
public long getMem()Return approximatively the amount of memory used for storing this MOC in RAM (in bytes) -
add
public void add(HealpixImpl healpix, double alpha, double delta, double jdmin, double jdmax) throws Exception STMoc specifical methods- Throws:
Exception
-
add
Adding one élément by spaceOrder/npix et [jdmin..jdmax]- Throws:
Exception
-
add
- Throws:
Exception
-
add
- Throws:
Exception
-
setTimeOrder
Set time order [0..61]- Overrides:
setTimeOrder
in classMoc
- Throws:
Exception
-
setSpaceOrder
Set space order [0..29]- Overrides:
setSpaceOrder
in classMoc
- Throws:
Exception
-
getTimeOrder
public int getTimeOrder()Get time order- Overrides:
getTimeOrder
in classMoc
-
getSpaceOrder
public int getSpaceOrder()Get space order- Overrides:
getSpaceOrder
in classMoc
-
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
-
setTimeSys
Set alternative Timesys. All celestial STMOC must be expressed in TCD (see IVOA MOC 2.0) but alternative is possible for other coverage notably the planets- Overrides:
setTimeSys
in classMoc
- Parameters:
sys
- alternative timesys keyword (not standardized in IVOA document)
-
getTimeSys
Get the Timesys- Overrides:
getTimeSys
in classMoc
-
getTimeMin
public double getTimeMin()Return minimal time in JD - -1 if empty -
getTimeMax
public double getTimeMax()Return maximal time in JD - -1 if empty -
getTimeRanges
public int getTimeRanges() -
getTimeMoc
TMoc covering from the whole STMOC- Overrides:
getTimeMoc
in classMoc
- Throws:
Exception
-
getTimeMoc
TMoc from the intersection with the spaceMoc- Throws:
Exception
-
getSpaceMoc
SMoc covering the whole STMOC- Overrides:
getSpaceMoc
in classMoc
- Throws:
Exception
-
getSpaceMoc
SMoc extraction from a temporal time- Parameters:
tmin
- min of range (order 61)tmax
- max of range (included - order 61)- Throws:
Exception
-
contains
public boolean contains(long npix, double jd) True if the npix (deepest level) and jd date is in the STMoc -
isIncluding
Operations- Specified by:
isIncluding
in classMoc
- Throws:
Exception
-
isIntersecting
- Specified by:
isIntersecting
in classMoc
- Throws:
Exception
-
union
Return the Union with another Moc -
subtraction
Return the subtraction with another Moc- Overrides:
subtraction
in classMoc
- Throws:
Exception
-
intersection
Return the Intersection with another Moc- Overrides:
intersection
in classMoc
- Throws:
Exception
-
complement
Return the complement- Specified by:
complement
in classMoc
- Throws:
Exception
-
writeSpecificFitsProp
Write specifical STMOC properties- Specified by:
writeSpecificFitsProp
in classMoc
- Throws:
Exception
-
codeDim1
protected long codeDim1(long a) -
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
-
isCodedTime
protected boolean isCodedTime(long a) - Overrides:
isCodedTime
in classMoc2D
-
decodeTime
protected long decodeTime(long a) - Overrides:
decodeTime
in classMoc2D
-
isCodedDim1
protected boolean isCodedDim1(long a) - Specified by:
isCodedDim1
in classMoc2D
-
decodeDim1
protected long decodeDim1(long a) - Specified by:
decodeDim1
in classMoc2D
-