Class GeminiImageRecord

java.lang.Object
tritechgemini.imagedata.PublicMessageHeader
tritechgemini.imagedata.GeminiImageRecord
All Implemented Interfaces:
Serializable, Cloneable, SonarImageRecordI, SonarRecordI
Direct Known Subclasses:
ECDImageRecord, GLFImageRecord

public abstract class GeminiImageRecord extends PublicMessageHeader implements SonarImageRecordI, Cloneable, Serializable
See Also:
  • Field Details

    • filePos

      public int filePos
      Position in file
    • isFullyRead

      public boolean isFullyRead
      Flag to say image has been read fully. It's quite possible that there is a file catalogue which just has the basic info (time and device id) without the full image and bearing table data to save on memory.
    • recordIndex

      public int recordIndex
      Index in file
    • bearingTable

      public double[] bearingTable
      Bearing table
    • imageData

      protected byte[] imageData
      Uncompressed image data.
  • Constructor Details

    • GeminiImageRecord

      public GeminiImageRecord(GLFGenericHeader glfGenericHeader, String filePath, int filePos, int recordIndex)
  • Method Details

    • getImageData

      public byte[] getImageData()
      Get uncompressed imageData.
      Specified by:
      getImageData in interface SonarImageRecordI
      Returns:
      image data in a single array
    • setImageData

      public void setImageData(byte[] imageData)
      Set the uncompressed image data.
      Specified by:
      setImageData in interface SonarImageRecordI
      Parameters:
      imageData -
    • getShortImageData

      public short[] getShortImageData()
      Get the decompressed image data in an array of shorts this allows correction of problems caused by Java not understanding unsigned values, so what should be large values (>=128) are negative.
      This will return an array of values between 0 and 255
      Specified by:
      getShortImageData in interface SonarImageRecordI
      Returns:
      Decompressed raw data in short format.
    • getNBeam

      public int getNBeam()
      Returns:
      the number of beams
    • getBearingTable

      public double[] getBearingTable()
      Specified by:
      getBearingTable in interface SonarImageRecordI
      Returns:
      List of beam angles in radians.
    • getFilePath

      public String getFilePath()
      Description copied from interface: SonarImageRecordI
      Path to the image file
      Specified by:
      getFilePath in interface SonarImageRecordI
      Returns:
      path name of file
    • getRecordNumber

      public int getRecordNumber()
      Specified by:
      getRecordNumber in interface SonarImageRecordI
      Returns:
      Record number in file (zero indexed)
    • setRecordNumber

      public void setRecordNumber(int recordNumber)
      Description copied from interface: SonarImageRecordI
      Set the record number
      Specified by:
      setRecordNumber in interface SonarImageRecordI
      Parameters:
      recordNumber -
    • isFullyLoaded

      public boolean isFullyLoaded()
      Description copied from interface: SonarImageRecordI
      Is record fully loaded ?
      Specified by:
      isFullyLoaded in interface SonarImageRecordI
      Returns:
      true if record is fully loaded.
    • setLoadTime

      public void setLoadTime(long nanos)
      Description copied from interface: SonarImageRecordI
      Record how long it took to load the record in nanoseconds.
      Specified by:
      setLoadTime in interface SonarImageRecordI
    • getLoadTime

      public long getLoadTime()
      Description copied from interface: SonarImageRecordI
      Get the record load time in nanoseconds.
      Specified by:
      getLoadTime in interface SonarImageRecordI
      Returns:
    • freeImageData

      public void freeImageData()
      Description copied from interface: SonarImageRecordI
      Free the data to save memory.
      Specified by:
      freeImageData in interface SonarImageRecordI
    • clone

      public GeminiImageRecord clone()
      Description copied from interface: SonarImageRecordI
      Clone in interface which is properly overridden in inherited classes
      Specified by:
      clone in interface SonarImageRecordI
      Overrides:
      clone in class Object
      Returns:
      cloned record.
    • getBearingIndex

      public int getBearingIndex(double bearing)
      Description copied from interface: SonarImageRecordI
      Get the index from the bearing table of the bearing closest to the given bearing.
      Specified by:
      getBearingIndex in interface SonarImageRecordI
      Parameters:
      bearing - in radians
      Returns:
      index of closest bearing.
    • getRangeIndex

      public int getRangeIndex(double range)
      Description copied from interface: SonarImageRecordI
      Get the index of the range bin closest to the given range
      Specified by:
      getRangeIndex in interface SonarImageRecordI
      Parameters:
      range - range in metres
      Returns:
      index of closest range bin.
    • getEchoLineStore

      public EchoLineStore getEchoLineStore()
      Description copied from interface: SonarImageRecordI
      Get storage for echogram lines.
      Specified by:
      getEchoLineStore in interface SonarImageRecordI
      Returns: