Package edu.sc.seis.seisFile.earthworm
Class TraceBuf2
java.lang.Object
edu.sc.seis.seisFile.earthworm.TraceBuf2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final String
static final String
static final String
static final String
static final String
static final int
static final int
static final int
static final int
static final int
static final int
static final String
static final short
static final int
static final String
static final String
static final String
static final String
static final int
static final int
static final String
static long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
for use by static read method.TraceBuf2
(byte[] data) TraceBuf2
(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, double[] data) TraceBuf2
(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, float[] data) TraceBuf2
(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, int[] intData) TraceBuf2
(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, short[] data) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkRecordLengthExp
(int recLenExp) edu.iris.dmc.seedcodec.SteimFrameBlock
encodeSteim1
(int recLenExp) encodes the data as Steim1.edu.iris.dmc.seedcodec.SteimFrameBlock
encodeSteim1
(int recLenExp, int offset) encodes the data starting at offset as Steim1.edu.iris.dmc.seedcodec.SteimFrameBlock
encodeSteim2
(int recLenExp) encodes the data as Steim2.edu.iris.dmc.seedcodec.SteimFrameBlock
encodeSteim2
(int recLenExp, int offset) encodes the data starting at offset as Steim1.static String
extractDataType
(byte[] data) static int
extractNumSamples
(byte[] data, boolean swapBytes) double[]
double
float[]
int[]
getLocId()
int
short
getPad()
int
getPin()
Predicted start of the next tracebuf.double
Predicted start of the next tracebuf in seconds.short
double
static int
getSampleSize
(String dataType) byte
short[]
int
getSize()
double
boolean
static boolean
isDoubleData
(String dataType) boolean
static boolean
isFloatData
(String dataType) boolean
static boolean
boolean
static boolean
isShortData
(String dataType) static boolean
isSwapBytes
(String dataType) static TraceBuf2
split
(int maxSize) byte[]
toMiniSeed
(int recLenExp, int compressionType) toMiniSeedNoCompression
(int recLenExp) toMiniSeedNoSplit
(int recLenExp, boolean steim1) toString()
void
write
(DataOutputStream out)
-
Field Details
-
LOC_NULL_STRING
- See Also:
-
MAX_TRACEBUF_SIZE
public static final int MAX_TRACEBUF_SIZE- See Also:
-
AMPLIFIER_SATURATED
public static final int AMPLIFIER_SATURATED- See Also:
-
DIGITIZER_CLIPPED
public static final int DIGITIZER_CLIPPED- See Also:
-
SPIKES_DETECTED
public static final int SPIKES_DETECTED- See Also:
-
GLITCHES_DETECTED
public static final int GLITCHES_DETECTED- See Also:
-
MISSING_DATA_PRESENT
public static final int MISSING_DATA_PRESENT- See Also:
-
TELEMETRY_SYNCH_ERROR
public static final int TELEMETRY_SYNCH_ERROR- See Also:
-
FILTER_CHARGING
public static final int FILTER_CHARGING- See Also:
-
TIME_TAG_QUESTIONABLE
public static final int TIME_TAG_QUESTIONABLE- See Also:
-
HEADER_SIZE
public static final int HEADER_SIZE- See Also:
-
SUN_IEEE_SINGLE_PRECISION_REAL
- See Also:
-
SUN_IEEE_DOUBLE_PRECISION_REAL
- See Also:
-
SUN_IEEE_INTEGER
- See Also:
-
SUN_IEEE_SHORT_INTEGER
- See Also:
-
INTEL_IEEE_SINGLE_PRECISION_REAL
- See Also:
-
INTEL_IEEE_DOUBLE_PRECISION_REAL
- See Also:
-
INTEL_IEEE_INTEGER
- See Also:
-
INTEL_IEEE_SHORT_INTEGER
- See Also:
-
NORESS_GAIN_RANGED
- See Also:
-
TRACEBUF_VERSION
- See Also:
-
MAX_NET_LEN
public static final int MAX_NET_LEN- See Also:
-
MAX_STA_LEN
public static final int MAX_STA_LEN- See Also:
-
MAX_LOC_LEN
public static final int MAX_LOC_LEN- See Also:
-
MAX_CHAN_LEN
public static final int MAX_CHAN_LEN- See Also:
-
S_ZERO
public static final short S_ZERO- See Also:
-
Y1970_TO_Y2000_SECONDS
public static long Y1970_TO_Y2000_SECONDS
-
-
Constructor Details
-
TraceBuf2
protected TraceBuf2()for use by static read method. -
TraceBuf2
-
TraceBuf2
-
TraceBuf2
-
TraceBuf2
-
TraceBuf2
public TraceBuf2(byte[] data)
-
-
Method Details
-
read
- Throws:
IOException
-
extractNumSamples
public static int extractNumSamples(byte[] data, boolean swapBytes) -
extractDataType
-
isSwapBytes
-
getSampleSize
-
write
- Throws:
IOException
-
split
-
isShortData
public boolean isShortData() -
isIntData
public boolean isIntData() -
isFloatData
public boolean isFloatData() -
isDoubleData
public boolean isDoubleData() -
isShortData
-
isIntData
-
isFloatData
-
isDoubleData
-
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
Predicted start of the next tracebuf. -
getStartDate
-
getEndDate
-
getSampleRate
public double getSampleRate() -
getStation
-
getNetwork
-
getChannel
-
formatNSLCCodes
-
getLocId
-
getVersion
-
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
- Throws:
IOException
-
encodeSteim1
public edu.iris.dmc.seedcodec.SteimFrameBlock encodeSteim1(int recLenExp) throws SeedFormatException encodes 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 SeedFormatException encodes 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 SeedFormatException encodes 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 SeedFormatException encodes 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
- Throws:
SeedFormatException
-
toMiniSeed
- Throws:
SeedFormatException
-
toMiniSeedNoSplit
- Throws:
SeedFormatException
-
getSize
public int getSize() -
toString
-
toStringWithData
-