simplemseed.steim2
Module Contents
Functions
Decode Steim2 data. |
|
Encode samples as Steim2 compress. |
|
Pack Steim2 compressed word with optional submask. @param diff the differences @param nbits the number of bits @param ndiff the number of differences @param bitmask the bit mask @param submask the sub mask or 0 if none |
API
- simplemseed.steim2.decodeSteim2(dataBytes: bytearray, numSamples: int, bias: int = 0)
Decode Steim2 data.
Decode the indicated number of samples from the provided byte array and return an integer array of the decompressed values. Being differencing compression, there may be an offset carried over from a previous data record. This offset value can be placed in <b>bias</b>, otherwise leave the value as 0.
- simplemseed.steim2.encodeSteim2(samples: Union[numpy.ndarray, list[int]], frames: int = 0, bias: numpy.int32 = 0)
Encode samples as Steim2 compress.
Encode the array of integer values into a Steim 2 * compressed byte frame block. For miniseed2 you should not create a byte block any greater than 63 64-byte frames. <b>frames</b> represents the number of frames to be written. This number should be determined from the desired logical record length <i>minus</i> the data offset from the record header (modulo 64) If <b>samples</b> is exhausted before all frames are filled, the remaining frames will be None. <b>bias</b> is a value carried over from a previous data record, representing X(-1)…set to 0 otherwise @param samples the data points represented as signed integers @param frames the number of Steim frames to use in the encoding @param bias offset for use as a constant for the first difference, otherwise set to 0 @return SteimFrameBlock containing encoded byte array @throws SteimException samples array is zero size @throws SteimException number of frames is not a positive value @throws SteimException cannot encode more than 63 frames
- simplemseed.steim2.encodeSteim2FrameBlock(samples: Union[numpy.ndarray, list[int]], frames: int = 0, bias: numpy.int32 = 0) simplemseed.steimframeblock.SteimFrameBlock
- simplemseed.steim2.extractDnibValues(tempInt, headerSize, diffCount, bitSize)
- simplemseed.steim2.extractSteim2Samples(dataBytes: bytearray, offset: int, littleEndian: bool) numpy.ndarray
- simplemseed.steim2.steimPackWord(diff: list[int], nbits: int, ndiff: int, bitmask: numpy.int32, submask: numpy.int32) numpy.int32
Pack Steim2 compressed word with optional submask. @param diff the differences @param nbits the number of bits @param ndiff the number of differences @param bitmask the bit mask @param submask the sub mask or 0 if none