Package PamguardMVC

Class RawDataUtils

java.lang.Object
PamguardMVC.RawDataUtils

public class RawDataUtils extends Object
A few useful functions for handling raw data which are better off in a simple class rather than linked to a data unit, such as the functions in RawDataTransforms.
This was copied from the ClipBinaryStorage class so cannot easily be changed without breaking backwards compatibility.
If it must be changed (which will happen one day) then I suggest an id flag as the first int16 which is always negative. Then if it's >0 we know it's a channel number in the old format, if invalid input: '<'0 a new as yet to be defined format.
An obvious future development would be to write x3 or even simple zipped packets.
Author:
dg50
  • Constructor Details

    • RawDataUtils

      public RawDataUtils()
  • Method Details

    • writeWaveClipInt8

      public void writeWaveClipInt8(DataOutputStream dos, double[][] rawData) throws IOException
      Write the wave clip in scaled int8 format into a data output stream. If rawData is null or empty, it will still write the header consisting of nChan, nSamp and a scale, but no data.
      Parameters:
      dos - Data output stream
      rawData - raw data
      Throws:
      IOException
    • readWavClipInt8

      public double[][] readWavClipInt8(DataInputStream dis) throws IOException
      Read a waveform clip in scaled int8 format from a data input stream
      Parameters:
      dis - data input stream
      Returns:
      waveform double array or null if nChan or nSamps was zero (implying an empty array was written in the fist place)
      Throws:
      IOException