Package cds.moc
Class TMoc
java.lang.Object
cds.moc.Moc
cds.moc.Moc1D
cds.moc.TMoc
- All Implemented Interfaces:
Cloneable
,Comparable<Moc>
,Iterable<MocCell>
The TMoc class implements the methods specific to temporal MOCs.
It is based on the JD discretization of the time at the µs.
See: IVOA MOC 2.0 standard => https://www.ivoa.net/documents/MOC/
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
static 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
(double jdmin, double jdmax) Add JD rangevoid
Add directly a TMocfinal char
cDim()
Return the Moc signature character (ex: 's' for SMoc, 't' for TMOC)clone()
Clone Moc (deep copy)protected void
Deep copy.Return the complementboolean
contains
(double jd) True if the jd date is in TMOCdup()
Create and instance of same class, same sys, but no data nor mocorderstatic long
getDuration
(int order) Return the duration of a cell for a specifical order (in microsec)static long
getMicrosec
(double jd, long offset) Compute the microsec from JD=0 from a date jd (in JD unit=day decimal) and an offset (in JD unit=day)int
Return the number of values to write in FITS serializationstatic double
getTime
(int order, long val) Return JD time for a couple order/npixdouble
Return maximal time in JD - -1 if emptydouble
Return minimal time in JD - -1 if emptyGet the Timesysintersection
(Moc moc) Return the Intersection with another Mocboolean
isIncluding
(Moc moc) Operationsboolean
isIntersecting
(Moc moc) Iterator
<long[]> jdIterator
(double jdStart, double jdStop) Returns a rangeIterator, which iterates over all individual rangefinal 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)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.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 (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 specifical TMoc propertiesMethods inherited from class cds.moc.Moc1D
add, add, add, addToken, bufferOff, bufferOn, bufferOn, bufferSize, cellIterator, clear, computeHierarchy, createMocByUniq, createMocByUniqUnsorted, equals, flush, getCoverage, getEnd, getMem, getMinOrder, getMocOrder, getNbRanges, getNbValues, getStart, getSys, hashCode, isCompatible, isEmpty, isFull, isIncluding, isIntersecting, lowAscii, operation, readSpecificDataRange, readSpecificDataRange, readSpecificDataUniq, reduction, seeRangeList, setMinOrder, 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, getSpaceSys, getSpaceTimeMoc, getTimeMoc, getTimeOrder, getUnitDisk, getUnitDisk, hpix2uniq, isCodedComp, isSpace, isTime, iterator, json2ASCII, log2, pow2, read, read, read, readASCII, readFITS, readFully, readFully, readJSON, readLong, resetCache, setMocOrderLogic, setProperty, setProperty, setSpaceOrder, setSpaceSys, setTimeOrder, setTimeSys, 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
-
Field Details
-
DAYMICROSEC
public static final double DAYMICROSEC- See Also:
-
MAXORD_T
public static final int MAXORD_T- See Also:
-
FACT_T
public static final int FACT_T- See Also:
-
DIM_T
public static final char DIM_T- See Also:
-
NBVAL_T
public static final long NBVAL_T -
SYS_T
- 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 -
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 (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 TMoc -
getTimeSys
Get the Timesys- Overrides:
getTimeSys
in classMoc
-
getMicrosec
public static long getMicrosec(double jd, long offset) Compute the microsec from JD=0 from a date jd (in JD unit=day decimal) and an offset (in JD unit=day) -
add
Add JD range- Parameters:
jdmin
- start time (in JD - unit=day) - included in the range (NaN for infinity)jdmax
- end time (in JD - unit=day) - included in the range (NaN for infinity)- Throws:
Exception
-
contains
public boolean contains(double jd) True if the jd date is in TMOC -
getTimeMin
public double getTimeMin()Return minimal time in JD - -1 if empty -
getTimeMax
public double getTimeMax()Return maximal time in JD - -1 if empty -
getTime
public static double getTime(int order, long val) Return JD time for a couple order/npix -
getDuration
public static long getDuration(int order) Return the duration of a cell for a specifical order (in microsec) -
jdIterator
Returns a rangeIterator, which iterates over all individual range- Parameters:
jdStart
- JD start timejdStop
- JD end time- Returns:
- iterator of range in microseconds
-
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 TMoc properties- Specified by:
writeSpecificFitsProp
in classMoc
- Throws:
Exception
-