ASCII

ascii

ASCII

Type: number

SHORT

16 bit integer, or java short

SHORT

Type: number

INT24

24 bit integer

INT24

Type: number

INTEGER

32 bit integer, or java int

INTEGER

Type: number

FLOAT

ieee float

FLOAT

Type: number

DOUBLE

ieee double

DOUBLE

Type: number

STEIM1

Steim1 compression

STEIM1

Type: number

STEIM2

Steim2 compression

STEIM2

Type: number

CDSN

CDSN 16 bit gain ranged

CDSN

Type: number

SRO

(A)SRO

SRO

Type: number

DWWSSN

DWWSSN 16 bit

DWWSSN

Type: number

CodecException

new CodecException(message: string)

Extends Error

Parameters
message (string)

UnsupportedCompressionType

new UnsupportedCompressionType(message: string)

Extends Error

Parameters
message (string)

isFloatCompression

isFloatCompression(compressionType: number): boolean
Parameters
compressionType (number)
Returns
boolean

EncodedDataSegment

A holder for compressed data independent of the file format.

new EncodedDataSegment(compressionType: number, dataView: DataView, numSamples: number, littleEndian: boolean)
Parameters
compressionType (number)
dataView (DataView)
numSamples (number)
littleEndian (boolean)
Instance Members
compressionType
dataView
numSamples
littleEndian
isFloatCompression()

decompress

Decompress the samples from the provided DataView and return an array of the decompressed values. Only 16 bit short, 32 bit int, 32 bit float and 64 bit double along with Steim1 and Steim2 are supported.

decompress(compressionType: number, dataView: DataView, numSamples: number, littleEndian: boolean): (Int32Array | Float32Array | Float64Array)
Parameters
compressionType (number) compression format as defined in SEED blockette 1000
dataView (DataView) input DataView to be decoded
numSamples (number) the number of samples that can be decoded from array b
littleEndian (boolean) if true, dataView is little-endian (intel byte order) b .
Returns
(Int32Array | Float32Array | Float64Array): array of length numSamples .
Throws
  • any: CodecException fail to decompress.
  • any: UnsupportedCompressionType unsupported compression type

decodeSteim1

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 bias, otherwise leave the value as 0.

decodeSteim1(dataView: DataView, numSamples: number, littleEndian: boolean, bias: number): Int32Array
Parameters
dataView (DataView) input DataView to be decoded
numSamples (number) the number of samples that can be decoded from array b
littleEndian (boolean) if true, dataView is little-endian (intel byte order) b .
bias (number) the first difference value will be computed from this value. If set to 0, the method will attempt to use the X(0) constant instead.
Returns
Int32Array: int array of length numSamples .
Throws
  • any: CodecException - encoded data length is not multiple of 64 bytes.

decodeSteim2

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 bias, otherwise leave the value as 0.

decodeSteim2(dataView: DataView, numSamples: number, swapBytes: boolean, bias: number): Int32Array
Parameters
dataView (DataView) input byte array to be decoded
numSamples (number) the number of samples that can be decoded from array
swapBytes (boolean) if true, swap reverse the endian-ness of the elements of dataview
bias (number) the first difference value will be computed from this value. If set to 0, the method will attempt to use the X(0) constant instead.
Returns
Int32Array: int array of length numSamples .
Throws
  • any: SteimException - encoded data length is not multiple of 64 bytes.