ascii

ASCII

Type: number

16 bit integer, or java short

SHORT

Type: number

24 bit integer

INT24

Type: number

32 bit integer, or java int

INTEGER

Type: number

ieee float

FLOAT

Type: number

ieee double

DOUBLE

Type: number

Steim1 compression

STEIM1

Type: number

Steim2 compression

STEIM2

Type: number

CDSN 16 bit gain ranged

CDSN

Type: number

(A)SRO

SRO

Type: number

DWWSSN 16 bit

DWWSSN

Type: number

CodecException

src/seedcodec.ts
new CodecException(message: string)

Extends Error

Parameters
message (string)

UnsupportedCompressionType

src/seedcodec.ts
new UnsupportedCompressionType(message: string)

Extends Error

Parameters
message (string)

isFloatCompression

src/seedcodec.ts
isFloatCompression(compressionType: number): boolean
Parameters
compressionType (number)
Returns
boolean

EncodedDataSegment

src/seedcodec.ts

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 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

src/seedcodec.ts

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

src/seedcodec.ts

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.