simplemseed.steimframeblock

Module Contents

Classes

SteimFrame

This represents a single Steim compression frame. It stores values as an int array and keeps track of it’s current position in the frame.

SteimFrameBlock

This class acts as a container to hold encoded bytes processed by a Steim compression routine, as well as supporting information relating to the data processed. It also facilitates Steim notation and the formation of the data frames. This class stores the Steim encoding, but is ignorant of the encoding process itself…it’s just for self-referencing.

Functions

getFloat32

getInt16

getInt32

getUint32

API

class simplemseed.steimframeblock.SteimFrame

This represents a single Steim compression frame. It stores values as an int array and keeps track of it’s current position in the frame.

Initialization

isEmpty()
pack()
class simplemseed.steimframeblock.SteimFrameBlock(maxNumFrames: int = 0, steimVersion: int = 2)

This class acts as a container to hold encoded bytes processed by a Steim compression routine, as well as supporting information relating to the data processed. It also facilitates Steim notation and the formation of the data frames. This class stores the Steim encoding, but is ignorant of the encoding process itself…it’s just for self-referencing.

Converted to Python from Java, edu.iris.dmc.seedcodec @author Robert Casey (IRIS DMC) @version 12/10/2001

Initialization

Create a new block of Steim frames for a particular version of Steim copression. Instantiate object with the number of 64-byte frames that this block will contain (should connect to data record header such that a proper power of 2 boundary is formed for the data record) AND the version of Steim compression used (1 and 2 currently) the number of frames remains static…frames that are not filled with data are simply full of Nones. @param maxNumFrames the max number of frames in this Steim record, zero for unlimited @param steimVersion which version of Steim compression is being used (1,2,3).

addEncodedWord(word: numpy.int32, samples: int, nibble: int)

Add a single 32-bit word to current frame. @param samples the number of sample differences in the word @param nibble a value of 0 to 3 that reflects the W0 encoding for this word @return boolean indicating true if the block is full (ie: the calling app should not add any more to this object)

addEncodingNibble(bitFlag: numpy.int32)
  • Add encoding nibble to W0.

  • @param bitFlag a value 0 to 3 representing an encoding nibble

currentFrame: int = None
currentSteimFrame: simplemseed.steimframeblock.SteimFrame = None
getEncodedData()

Return the compressed byte representation of the data for inclusion in a data record. @return byte array containing the encoded, compressed data @throws IOException from called method(s)

getNumFrames()

Return the number of frames in this frame block @return integer value indicating number of frames

getNumSamples()

Return the number of data samples represented by this frame block @return integer value indicating number of samples

getSteimFrames()
getSteimVersion()

Return the version of Steim compression used @return integer value representing the Steim version (1,2,3)

maxNumFrames: int = None
numSamples: int = None
pack()
setXsubN(word: numpy.int32)

Set the reverse integration constant X(N) explicitly to the provided word value. This method is typically used to reset X(N) should the compressor fill the frame block before all samples have been read. @param word integer value to be placed in X(N)

steimFrameList: list[simplemseed.steimframeblock.SteimFrame] = None
steimVersion: int = None
simplemseed.steimframeblock.getFloat32(dataBytes, offset, littleEndian)
simplemseed.steimframeblock.getInt16(dataBytes, offset, littleEndian)
simplemseed.steimframeblock.getInt32(dataBytes, offset, littleEndian)
simplemseed.steimframeblock.getUint32(dataBytes, offset, littleEndian)