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 doublestatic 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(double jdmin, double jdmax) Add JD rangevoidAdd directly a TMocfinal charcDim()Return the Moc signature character (ex: 's' for SMoc, 't' for TMOC)clone()Clone Moc (deep copy)protected voidDeep copy.Return the complementbooleancontains(double jd) True if the jd date is in TMOCdup()Create and instance of same class, same sys, but no data nor mocorderstatic longgetDuration(int order) Return the duration of a cell for a specifical order (in microsec)static longgetMicrosec(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)intReturn the number of values to write in FITS serializationstatic doublegetTime(int order, long val) Return JD time for a couple order/npixdoubleReturn maximal time in JD - -1 if emptydoubleReturn minimal time in JD - -1 if emptyGet the Timesysintersection(Moc moc) Return the Intersection with another MocbooleanisIncluding(Moc moc) OperationsbooleanisIntersecting(Moc moc) Iterator<long[]> jdIterator(double jdStart, double jdStop) Returns a rangeIterator, which iterates over all individual rangefinal 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)protected 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.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 (8 for long)subtraction(Moc moc) Return the subtraction with another Mocfinal Stringsys()Return the default reference systemReturn the Union with another Mocprotected intWrite 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, 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, 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, writeValMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
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 -
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 (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 TMoc -
getTimeSys
Get the Timesys- Overrides:
getTimeSysin 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:
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 TMoc properties- Specified by:
writeSpecificFitsPropin classMoc- Throws:
Exception
-