Package edu.sc.seis.seisFile.earthworm
Class TraceBuf2
- java.lang.Object
-
- edu.sc.seis.seisFile.earthworm.TraceBuf2
-
public class TraceBuf2 extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intAMPLIFIER_SATURATEDstatic intDIGITIZER_CLIPPEDstatic intFILTER_CHARGINGstatic intGLITCHES_DETECTEDstatic intHEADER_SIZEstatic java.lang.StringINTEL_IEEE_DOUBLE_PRECISION_REALstatic java.lang.StringINTEL_IEEE_INTEGERstatic java.lang.StringINTEL_IEEE_SHORT_INTEGERstatic java.lang.StringINTEL_IEEE_SINGLE_PRECISION_REALstatic java.lang.StringLOC_NULL_STRINGstatic intMAX_CHAN_LENstatic intMAX_LOC_LENstatic intMAX_NET_LENstatic intMAX_STA_LENstatic intMAX_TRACEBUF_SIZEstatic intMISSING_DATA_PRESENTstatic java.lang.StringNORESS_GAIN_RANGEDstatic shortS_ZEROstatic intSPIKES_DETECTEDstatic java.lang.StringSUN_IEEE_DOUBLE_PRECISION_REALstatic java.lang.StringSUN_IEEE_INTEGERstatic java.lang.StringSUN_IEEE_SHORT_INTEGERstatic java.lang.StringSUN_IEEE_SINGLE_PRECISION_REALstatic intTELEMETRY_SYNCH_ERRORstatic intTIME_TAG_QUESTIONABLEstatic java.lang.StringTRACEBUF_VERSIONstatic longY1970_TO_Y2000_SECONDS
-
Constructor Summary
Constructors Modifier Constructor Description protectedTraceBuf2()for use by static read method.TraceBuf2(byte[] data)TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, double[] data)TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, float[] data)TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, int[] intData)TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, short[] data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckRecordLengthExp(int recLenExp)edu.iris.dmc.seedcodec.SteimFrameBlockencodeSteim1(int recLenExp)encodes the data as Steim1.edu.iris.dmc.seedcodec.SteimFrameBlockencodeSteim1(int recLenExp, int offset)encodes the data starting at offset as Steim1.edu.iris.dmc.seedcodec.SteimFrameBlockencodeSteim2(int recLenExp)encodes the data as Steim2.edu.iris.dmc.seedcodec.SteimFrameBlockencodeSteim2(int recLenExp, int offset)encodes the data starting at offset as Steim1.static java.lang.StringextractDataType(byte[] data)static intextractNumSamples(byte[] data, boolean swapBytes)java.lang.StringformatNSLCCodes()java.lang.StringgetChannel()java.lang.StringgetDataType()double[]getDoubleData()java.time.InstantgetEndDate()doublegetEndTime()float[]getFloatData()int[]getIntData()java.lang.StringgetLocId()java.lang.StringgetNetwork()intgetNumSamples()shortgetPad()intgetPin()java.time.InstantgetPredictedNextStartDate()Predicted start of the next tracebuf.doublegetPredictedNextStartTime()Predicted start of the next tracebuf in seconds.shortgetQuality()doublegetSampleRate()static intgetSampleSize(java.lang.String dataType)bytegetSeedEncoding()short[]getShortData()intgetSize()java.time.InstantgetStartDate()doublegetStartTime()java.lang.StringgetStation()java.lang.StringgetVersion()booleanisDoubleData()static booleanisDoubleData(java.lang.String dataType)booleanisFloatData()static booleanisFloatData(java.lang.String dataType)booleanisIntData()static booleanisIntData(java.lang.String dataType)booleanisShortData()static booleanisShortData(java.lang.String dataType)static booleanisSwapBytes(java.lang.String dataType)static TraceBuf2read(java.io.DataInput in)java.util.List<TraceBuf2>split(int maxSize)byte[]toByteArray()java.util.List<DataRecord>toMiniSeed(int recLenExp, int compressionType)java.util.List<DataRecord>toMiniSeedNoCompression(int recLenExp)DataRecordtoMiniSeedNoSplit(int recLenExp, boolean steim1)java.lang.StringtoString()java.lang.StringtoStringWithData()voidwrite(java.io.DataOutputStream out)
-
-
-
Field Detail
-
LOC_NULL_STRING
public static final java.lang.String LOC_NULL_STRING
- See Also:
- Constant Field Values
-
MAX_TRACEBUF_SIZE
public static final int MAX_TRACEBUF_SIZE
- See Also:
- Constant Field Values
-
AMPLIFIER_SATURATED
public static final int AMPLIFIER_SATURATED
- See Also:
- Constant Field Values
-
DIGITIZER_CLIPPED
public static final int DIGITIZER_CLIPPED
- See Also:
- Constant Field Values
-
SPIKES_DETECTED
public static final int SPIKES_DETECTED
- See Also:
- Constant Field Values
-
GLITCHES_DETECTED
public static final int GLITCHES_DETECTED
- See Also:
- Constant Field Values
-
MISSING_DATA_PRESENT
public static final int MISSING_DATA_PRESENT
- See Also:
- Constant Field Values
-
TELEMETRY_SYNCH_ERROR
public static final int TELEMETRY_SYNCH_ERROR
- See Also:
- Constant Field Values
-
FILTER_CHARGING
public static final int FILTER_CHARGING
- See Also:
- Constant Field Values
-
TIME_TAG_QUESTIONABLE
public static final int TIME_TAG_QUESTIONABLE
- See Also:
- Constant Field Values
-
HEADER_SIZE
public static final int HEADER_SIZE
- See Also:
- Constant Field Values
-
SUN_IEEE_SINGLE_PRECISION_REAL
public static final java.lang.String SUN_IEEE_SINGLE_PRECISION_REAL
- See Also:
- Constant Field Values
-
SUN_IEEE_DOUBLE_PRECISION_REAL
public static final java.lang.String SUN_IEEE_DOUBLE_PRECISION_REAL
- See Also:
- Constant Field Values
-
SUN_IEEE_INTEGER
public static final java.lang.String SUN_IEEE_INTEGER
- See Also:
- Constant Field Values
-
SUN_IEEE_SHORT_INTEGER
public static final java.lang.String SUN_IEEE_SHORT_INTEGER
- See Also:
- Constant Field Values
-
INTEL_IEEE_SINGLE_PRECISION_REAL
public static final java.lang.String INTEL_IEEE_SINGLE_PRECISION_REAL
- See Also:
- Constant Field Values
-
INTEL_IEEE_DOUBLE_PRECISION_REAL
public static final java.lang.String INTEL_IEEE_DOUBLE_PRECISION_REAL
- See Also:
- Constant Field Values
-
INTEL_IEEE_INTEGER
public static final java.lang.String INTEL_IEEE_INTEGER
- See Also:
- Constant Field Values
-
INTEL_IEEE_SHORT_INTEGER
public static final java.lang.String INTEL_IEEE_SHORT_INTEGER
- See Also:
- Constant Field Values
-
NORESS_GAIN_RANGED
public static final java.lang.String NORESS_GAIN_RANGED
- See Also:
- Constant Field Values
-
TRACEBUF_VERSION
public static final java.lang.String TRACEBUF_VERSION
- See Also:
- Constant Field Values
-
MAX_NET_LEN
public static final int MAX_NET_LEN
- See Also:
- Constant Field Values
-
MAX_STA_LEN
public static final int MAX_STA_LEN
- See Also:
- Constant Field Values
-
MAX_LOC_LEN
public static final int MAX_LOC_LEN
- See Also:
- Constant Field Values
-
MAX_CHAN_LEN
public static final int MAX_CHAN_LEN
- See Also:
- Constant Field Values
-
S_ZERO
public static final short S_ZERO
- See Also:
- Constant Field Values
-
Y1970_TO_Y2000_SECONDS
public static long Y1970_TO_Y2000_SECONDS
-
-
Constructor Detail
-
TraceBuf2
protected TraceBuf2()
for use by static read method.
-
TraceBuf2
public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, short[] data)
-
TraceBuf2
public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, int[] intData)
-
TraceBuf2
public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, float[] data)
-
TraceBuf2
public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, java.lang.String station, java.lang.String network, java.lang.String channel, java.lang.String locId, double[] data)
-
TraceBuf2
public TraceBuf2(byte[] data)
-
-
Method Detail
-
read
public static TraceBuf2 read(java.io.DataInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
extractNumSamples
public static int extractNumSamples(byte[] data, boolean swapBytes)
-
extractDataType
public static java.lang.String extractDataType(byte[] data)
-
isSwapBytes
public static boolean isSwapBytes(java.lang.String dataType)
-
getSampleSize
public static int getSampleSize(java.lang.String dataType)
-
write
public void write(java.io.DataOutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
split
public java.util.List<TraceBuf2> split(int maxSize)
-
isShortData
public boolean isShortData()
-
isIntData
public boolean isIntData()
-
isFloatData
public boolean isFloatData()
-
isDoubleData
public boolean isDoubleData()
-
isShortData
public static boolean isShortData(java.lang.String dataType)
-
isIntData
public static boolean isIntData(java.lang.String dataType)
-
isFloatData
public static boolean isFloatData(java.lang.String dataType)
-
isDoubleData
public static boolean isDoubleData(java.lang.String dataType)
-
getPin
public int getPin()
-
getNumSamples
public int getNumSamples()
-
getStartTime
public double getStartTime()
-
getEndTime
public double getEndTime()
-
getPredictedNextStartTime
public double getPredictedNextStartTime()
Predicted start of the next tracebuf in seconds.
-
getPredictedNextStartDate
public java.time.Instant getPredictedNextStartDate()
Predicted start of the next tracebuf.
-
getStartDate
public java.time.Instant getStartDate()
-
getEndDate
public java.time.Instant getEndDate()
-
getSampleRate
public double getSampleRate()
-
getStation
public java.lang.String getStation()
-
getNetwork
public java.lang.String getNetwork()
-
getChannel
public java.lang.String getChannel()
-
formatNSLCCodes
public java.lang.String formatNSLCCodes()
-
getLocId
public java.lang.String getLocId()
-
getVersion
public java.lang.String getVersion()
-
getDataType
public java.lang.String getDataType()
-
getQuality
public short getQuality()
-
getPad
public short getPad()
-
getShortData
public short[] getShortData()
-
getIntData
public int[] getIntData()
-
getFloatData
public float[] getFloatData()
-
getDoubleData
public double[] getDoubleData()
-
getSeedEncoding
public byte getSeedEncoding()
-
toByteArray
public byte[] toByteArray() throws java.io.IOException- Throws:
java.io.IOException
-
encodeSteim1
public edu.iris.dmc.seedcodec.SteimFrameBlock encodeSteim1(int recLenExp) throws SeedFormatExceptionencodes the data as Steim1. The encoding will stop when full, the caller must check the number of samples in the returned SteimFramBlock to ensure all samples were included.- Parameters:
recLenExp- power of 2 for record size, generally 8-12- Returns:
- Steim1 encoding of the data
- Throws:
SeedFormatException- if data is not integer or compression errors occur
-
encodeSteim1
public edu.iris.dmc.seedcodec.SteimFrameBlock encodeSteim1(int recLenExp, int offset) throws SeedFormatExceptionencodes the data starting at offset as Steim1. The encoding will stop when full, the caller must check the number of samples in the returned SteimFramBlock to ensure all samples were included.- Parameters:
recLenExp- power of 2 for record size, generally 8-12offset- starting point for encoding, first sample to use- Returns:
- Steim1 encoding of the data
- Throws:
SeedFormatException- if data is not integer or compression errors occur
-
encodeSteim2
public edu.iris.dmc.seedcodec.SteimFrameBlock encodeSteim2(int recLenExp) throws SeedFormatExceptionencodes the data as Steim2. The encoding will stop when full, the caller must check the number of samples in the returned SteimFramBlock to ensure all samples were included.- Parameters:
recLenExp- power of 2 for record size, generally 8-12- Returns:
- Steim2 encoding of the data
- Throws:
SeedFormatException- if data is not integer or compression errors occur
-
encodeSteim2
public edu.iris.dmc.seedcodec.SteimFrameBlock encodeSteim2(int recLenExp, int offset) throws SeedFormatExceptionencodes the data starting at offset as Steim1. The encoding will stop when full, the caller must check the number of samples in the returned SteimFramBlock to ensure all samples were included.- Parameters:
recLenExp- power of 2 for record size, generally 8-12offset- starting point for encoding, first sample to use- Returns:
- Steim2 encoding of the data
- Throws:
SeedFormatException- if data is not integer or compression errors occur
-
checkRecordLengthExp
public static void checkRecordLengthExp(int recLenExp)
-
toMiniSeedNoCompression
public java.util.List<DataRecord> toMiniSeedNoCompression(int recLenExp) throws SeedFormatException
- Throws:
SeedFormatException
-
toMiniSeed
public java.util.List<DataRecord> toMiniSeed(int recLenExp, int compressionType) throws SeedFormatException
- Throws:
SeedFormatException
-
toMiniSeedNoSplit
public DataRecord toMiniSeedNoSplit(int recLenExp, boolean steim1) throws SeedFormatException
- Throws:
SeedFormatException
-
getSize
public int getSize()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringWithData
public java.lang.String toStringWithData()
-
-