Package PamguardMVC
Class RawDataUtils
java.lang.Object
PamguardMVC.RawDataUtils
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.
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[][]
Read a waveform clip in scaled int8 format from a data input streamvoid
writeWaveClipInt8
(DataOutputStream dos, double[][] rawData) Write the wave clip in scaled int8 format into a data output stream.
-
Constructor Details
-
RawDataUtils
public RawDataUtils()
-
-
Method Details
-
writeWaveClipInt8
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 streamrawData
- raw data- Throws:
IOException
-
readWavClipInt8
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
-