Class ExposureId$

java.lang.Object
csw.params.core.models.ExposureId$

public class ExposureId$ extends Object
Factory for ExposureId instances and helper functions.
  • Field Details

    • MODULE$

      public static final ExposureId$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • ExposureId$

      public ExposureId$()
  • Method Details

    • withExposureNumber

      public ExposureId withExposureNumber(ExposureId exposureId, int exposureNumber)
      A convenience function to create a new ExposureId with a specific exposure number. Example: 2020A-001-123-WFOS-IMG1-SCI0-0001 with 3 => 2020A-001-123-WFOS-IMG1-SCI0-0003
      Parameters:
      exposureId - current ExposureId
      exposureNumber - desired exposure number
      Returns:
      ExposureId with specified exposure number
    • nextExposureNumber

      public ExposureId nextExposureNumber(ExposureId exposureId)
      A convenience function to create a new ExposureId with the next higher exposure number. Example: 2020A-001-123-WFOS-IMG1-SCI0-0001 => 2020A-001-123-WFOS-IMG1-SCI0-0002
      Parameters:
      exposureId - current ExposureId
      Returns:
      ExposureId with next higher exposure number
    • withSubArrayNumber

      public ExposureId withSubArrayNumber(ExposureId exposureId, int subArrayNumber)
      A convenience function to create a new ExposureId with the same exposure number and specified sub array number Example: 2020A-001-123-WFOS-IMG1-SCI0-0001, 3 => 2020A-001-123-WFOS-IMG1-SCI0-0002-03. Example: 2020A-001-123-WFOS-IMG1-SCI0-0002-00, 4 => 2020A-001-123-WFOS-IMG1-SCI0-0002-04.
      Parameters:
      exposureId - current ExposureId
      subArrayNumber - specified subArray number
      Returns:
      ExposureId with next higher ExposureNumber
    • nextSubArrayNumber

      public ExposureId nextSubArrayNumber(ExposureId exposureId)
      A convenience function to create a new ExposureId with the next higher sub array number. Example: 2020A-001-123-WFOS-IMG1-SCI0-0001 => 2020A-001-123-WFOS-IMG1-SCI0-0002-00. Example: 2020A-001-123-WFOS-IMG1-SCI0-0002-00 => 2020A-001-123-WFOS-IMG1-SCI0-0002-01.
      Parameters:
      exposureId - current ExposureId
      Returns:
      ExposureId with next higher ExposureNumber
    • withObsId

      public ExposureId withObsId(ExposureId exposureId, ObsId obsId)
      A convenience function to create a new ExposureId with a new ObsId object. Example: 2020A-001-123-WFOS-IMG1-SCI0-0001 => 2020A-001-228-WFOS-IMG1-SCI0-0001. Note that a standalone ExposureId will be changed to an ExposureId with an ObsId
      Parameters:
      exposureId - current ExposureId
      obsId - new ObsId as an ObsId
      Returns:
      a new ExposureId with given new ObsId
    • withObsId

      public ExposureId withObsId(ExposureId exposureId, String obsIdString)
      A convenience function to create a new ExposureId with a new ObsId as a String. Example: 2020A-001-123-WFOS-IMG1-SCI0-0001 => 2020A-001-228-WFOS-IMG1-SCI0-0001. Note that a standalone ExposureId will be changed to an ExposureId with an ObsId.
      Parameters:
      exposureId - current ExposureId
      obsIdString - new ObsId as a String
      Returns:
      ExposureId with given new ObsId
    • withUTC

      public ExposureId withUTC(ExposureId exposureId, UTCTime utc)
      A convenience function that allows creating a standalone ExposureId at a specific UTC date and time. Note than an ExposureId with an ObsId can be changed to a standalone ExposureId.
      Parameters:
      exposureId - current ExposureId
      utc - a UTCTime for the ExposureId
      Returns:
      a standalone ExposureId at the provided UTC
    • utcAsStandaloneString

      public String utcAsStandaloneString(UTCTime utcTime)
      The UTC time formatted as needed for a standalone ExposureId: YYYYMMDD-HHMMSS.
      Parameters:
      utcTime - (undocumented)
      Returns:
      the UTCTime formatted String
    • fromString

      public ExposureId fromString(String exposureId)
      A helper function that allows creating exposure id from string in java file.
      Parameters:
      exposureId - proper ExposureId as a String
      Returns:
      instance of ExposureId
    • apply

      public ExposureId apply(String exposureId)
      Create an ExposureId from a String of the 4 forms with and without an ObsId and with and without a subarray: IRIS-IMG-SCI0-0001,IRIS-IMG-SCI0-0001-02 when no ObsId is present. Or 2020A-001-123-IRIS-IMG-SCI0-0001 or 2020A-001-123-IRIS-IMG-SCI0-0001-02 when an ObsId is present.
      Parameters:
      exposureId - proper ExposureId as a String
      Returns:
      instance of ExposureId
      Throws:
      IllegalArgumentException - if the String does not follow the correct structure
    • apply

      public ExposureId apply(Subsystem subsystem, String det, TYPLevel typLevel, ExposureNumber exposureNumber)
      This creates a stand-alone ExposureId for the case when there is no ObsId available.
      Parameters:
      subsystem - Subsystem associated with exposure
      det - a valid detector String
      typLevel - the exposure's TYPLevel
      exposureNumber - the exposure's Exposure Number ExposureNumber
      Returns:
      A stand-alone ExposureId
    • apply

      public ExposureId apply(ObsId obsId, Subsystem subsystem, String det, TYPLevel typLevel, ExposureNumber exposureNumber)
      This creates an ExposureId with an ObsId.
      Parameters:
      obsId - a valid ObsId
      subsystem - Subsystem associated with exposure
      det - a valid detector String
      typLevel - the exposure's TYPLevel
      exposureNumber - the exposure's Exposure Number ExposureNumber
      Returns:
      A standalone ExposureId