Package cds.moc

Class TMoc

All Implemented Interfaces:
Cloneable, Comparable<Moc>, Iterable<MocCell>

public class TMoc extends Moc1D
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 Details

  • Constructor Details

  • Method Details

    • maxOrder

      public final int maxOrder()
      Return the deepest possible order (ex: 29 for SMoc, 61 for TMoc)
      Specified by:
      maxOrder in class Moc1D
    • 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 class Moc1D
    • cDim

      public final char cDim()
      Return the Moc signature character (ex: 's' for SMoc, 't' for TMOC)
      Specified by:
      cDim in class Moc1D
    • maxVal

      public final long maxVal()
      Return the number of values at the deepest order (ex: 2x2^29x2^29 for SMoc, 2^61 for TMoc)
      Specified by:
      maxVal in class Moc1D
    • sys

      public final String sys()
      Return the default reference system
      Specified by:
      sys in class Moc1D
    • clone

      public TMoc clone() throws CloneNotSupportedException
      Clone Moc (deep copy)
      Specified by:
      clone in class Moc
      Throws:
      CloneNotSupportedException
    • clone1

      protected void clone1(Moc moc) throws CloneNotSupportedException
      Deep copy. The source is this, the target is the Moc in parameter
      Overrides:
      clone1 in class Moc1D
      Throws:
      CloneNotSupportedException
    • dup

      public TMoc dup()
      Create and instance of same class, same sys, but no data nor mocorder
      Specified by:
      dup in class Moc
    • sizeOfCoding

      public int sizeOfCoding()
      Return the number of bytes used for coding each FITS value (8 for long)
      Specified by:
      sizeOfCoding in class Moc
    • getNbCoding

      public int getNbCoding()
      Return the number of values to write in FITS serialization
      Specified by:
      getNbCoding in class Moc
    • add

      public void add(Moc moc) throws Exception
      Add directly a TMoc
      Overrides:
      add in class Moc1D
      Throws:
      Exception
    • getTimeSys

      public String getTimeSys()
      Get the Timesys
      Overrides:
      getTimeSys in class Moc
    • 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

      public void add(double jdmin, double jdmax) throws Exception
      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

      public Iterator<long[]> jdIterator(double jdStart, double jdStop)
      Returns a rangeIterator, which iterates over all individual range
      Parameters:
      jdStart - JD start time
      jdStop - JD end time
      Returns:
      iterator of range in microseconds
    • isIncluding

      public boolean isIncluding(Moc moc) throws Exception
      Operations
      Specified by:
      isIncluding in class Moc
      Throws:
      Exception
    • isIntersecting

      public boolean isIntersecting(Moc moc) throws Exception
      Specified by:
      isIntersecting in class Moc
      Throws:
      Exception
    • union

      public TMoc union(Moc moc) throws Exception
      Return the Union with another Moc
      Overrides:
      union in class Moc
      Throws:
      Exception
    • intersection

      public TMoc intersection(Moc moc) throws Exception
      Return the Intersection with another Moc
      Overrides:
      intersection in class Moc
      Throws:
      Exception
    • subtraction

      public TMoc subtraction(Moc moc) throws Exception
      Return the subtraction with another Moc
      Overrides:
      subtraction in class Moc
      Throws:
      Exception
    • complement

      public TMoc complement() throws Exception
      Return the complement
      Overrides:
      complement in class Moc1D
      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 class Moc
      Parameters:
      in - The input stream
      naxis1 - size of FITS row (in bytes) (generally ==nbyte, but may be 1024 for buffering)
      naxis2 - number of values
      nbyte - size of each value (in bytes)
      header - HDU1 header
      Throws:
      Exception
    • writeSpecificFitsProp

      protected int writeSpecificFitsProp(OutputStream out) throws Exception
      Write specifical TMoc properties
      Specified by:
      writeSpecificFitsProp in class Moc
      Throws:
      Exception