Class TraceBuf2

java.lang.Object
edu.sc.seis.seisFile.earthworm.TraceBuf2

public class TraceBuf2 extends Object
  • Field Details

  • Constructor Details

    • TraceBuf2

      protected TraceBuf2()
      for use by static read method.
    • TraceBuf2

      public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, short[] data)
    • TraceBuf2

      public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, int[] intData)
    • TraceBuf2

      public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, float[] data)
    • TraceBuf2

      public TraceBuf2(int pin, int numSamples, double startTime, double sampleRate, String station, String network, String channel, String locId, double[] data)
    • TraceBuf2

      public TraceBuf2(byte[] data)
  • Method Details

    • read

      public static TraceBuf2 read(DataInput in) throws IOException
      Throws:
      IOException
    • extractNumSamples

      public static int extractNumSamples(byte[] data, boolean swapBytes)
    • extractDataType

      public static String extractDataType(byte[] data)
    • isSwapBytes

      public static boolean isSwapBytes(String dataType)
    • getSampleSize

      public static int getSampleSize(String dataType)
    • write

      public void write(DataOutputStream out) throws IOException
      Throws:
      IOException
    • split

      public 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(String dataType)
    • isIntData

      public static boolean isIntData(String dataType)
    • isFloatData

      public static boolean isFloatData(String dataType)
    • isDoubleData

      public static boolean isDoubleData(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 Instant getPredictedNextStartDate()
      Predicted start of the next tracebuf.
    • getStartDate

      public Instant getStartDate()
    • getEndDate

      public Instant getEndDate()
    • getSampleRate

      public double getSampleRate()
    • getStation

      public String getStation()
    • getNetwork

      public String getNetwork()
    • getChannel

      public String getChannel()
    • formatNSLCCodes

      public String formatNSLCCodes()
    • getLocId

      public String getLocId()
    • getVersion

      public String getVersion()
    • getDataType

      public 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 IOException
      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-12
      offset - 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-12
      offset - 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 List<DataRecord> toMiniSeedNoCompression(int recLenExp) throws SeedFormatException
      Throws:
      SeedFormatException
    • toMiniSeed

      public 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 String toString()
      Overrides:
      toString in class Object
    • toStringWithData

      public String toStringWithData()