Package cds.moc

Class STMoc

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

public class STMoc extends Moc2D
The STMoc class implements the methods specific to spatial temporal MOCs. See: IVOA MOC 2.0 standard => https://www.ivoa.net/documents/MOC/
  • Constructor Details

    • STMoc

      public STMoc()
      STMoc creator
    • STMoc

      public STMoc(int timeOrder, int spaceOrder) throws Exception
      STMoc creator
      Parameters:
      timeOrder - MocOrder for time dimension [0..61]
      spaceOrder - MocOrder for space dimension [0..29]
      Throws:
      Exception
    • STMoc

      public STMoc(String s) throws Exception
      STMoc creator
      Parameters:
      s - String containing a STMOC (ASCII, JSON)
      Throws:
      Exception
    • STMoc

      public STMoc(InputStream in) throws Exception
      STMoc creator
      Parameters:
      in - Input stream containing a STMOC (ASCII, JSON or FITS)
      Throws:
      Exception
    • STMoc

      public STMoc(TMoc tmoc, SMoc smoc) throws Exception
      STMoc creator from one TMOC and one SMOC
      Parameters:
      tmoc -
      smoc -
      Throws:
      Exception
  • Method Details

    • asSTMoc

      protected static STMoc asSTMoc(Moc moc) throws Exception
      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

      public STMoc 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 Moc2D
      Throws:
      CloneNotSupportedException
    • dup

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

      public void clear()
      Clear the MOC - data only (not the properties, nor the mocOrder)
      Overrides:
      clear in class Moc2D
    • 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 class Moc
    • getMem

      public long getMem()
      Return approximatively the amount of memory used for storing this MOC in RAM (in bytes)
      Overrides:
      getMem in class Moc2D
    • add

      public void add(HealpixImpl healpix, double alpha, double delta, double jdmin, double jdmax) throws Exception
      STMoc specifical methods
      Throws:
      Exception
    • add

      public void add(int order, long npix, double jdmin, double jdmax) throws Exception
      Adding one élément by spaceOrder/npix et [jdmin..jdmax]
      Throws:
      Exception
    • add

      public void add(long tmin, long tmax, long smin, long smax) throws Exception
      Throws:
      Exception
    • add

      public void add(double jdmin, double jdmax, SMoc smoc) throws Exception
      Throws:
      Exception
    • setTimeOrder

      public void setTimeOrder(int timeOrder) throws Exception
      Set time order [0..61]
      Overrides:
      setTimeOrder in class Moc
      Throws:
      Exception
    • setSpaceOrder

      public void setSpaceOrder(int spaceOrder) throws Exception
      Set space order [0..29]
      Overrides:
      setSpaceOrder in class Moc
      Throws:
      Exception
    • getTimeOrder

      public int getTimeOrder()
      Get time order
      Overrides:
      getTimeOrder in class Moc
    • getSpaceOrder

      public int getSpaceOrder()
      Get space order
      Overrides:
      getSpaceOrder in class Moc
    • setSpaceSys

      public void setSpaceSys(String coosys)
      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 class Moc
      Parameters:
      coosys - alternative coosys keyword (not standardized in IVOA document)
    • getSpaceSys

      public String getSpaceSys()
      Get the Coosys. See setSpaceSys()
      Overrides:
      getSpaceSys in class Moc
    • setTimeSys

      public void setTimeSys(String timesys)
      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 class Moc
      Parameters:
      sys - alternative timesys keyword (not standardized in IVOA document)
    • getTimeSys

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

      public TMoc getTimeMoc() throws Exception
      TMoc covering from the whole STMOC
      Overrides:
      getTimeMoc in class Moc
      Throws:
      Exception
    • getTimeMoc

      public TMoc getTimeMoc(SMoc spaceMoc) throws Exception
      TMoc from the intersection with the spaceMoc
      Throws:
      Exception
    • getSpaceMoc

      public SMoc getSpaceMoc() throws Exception
      SMoc covering the whole STMOC
      Overrides:
      getSpaceMoc in class Moc
      Throws:
      Exception
    • getSpaceMoc

      public SMoc getSpaceMoc(long tmin, long tmax) throws Exception
      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

      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 STMoc union(Moc moc) throws Exception
      Return the Union with another Moc
      Overrides:
      union in class Moc
      Throws:
      Exception
    • subtraction

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

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

      public STMoc complement() throws Exception
      Return the complement
      Specified by:
      complement in class Moc
      Throws:
      Exception
    • writeSpecificFitsProp

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

      protected long codeDim1(long a)
      Specified by:
      codeDim1 in class Moc2D
    • 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
    • isCodedTime

      protected boolean isCodedTime(long a)
      Overrides:
      isCodedTime in class Moc2D
    • decodeTime

      protected long decodeTime(long a)
      Overrides:
      decodeTime in class Moc2D
    • isCodedDim1

      protected boolean isCodedDim1(long a)
      Specified by:
      isCodedDim1 in class Moc2D
    • decodeDim1

      protected long decodeDim1(long a)
      Specified by:
      decodeDim1 in class Moc2D