2.0.0-alpha.6
const for unknown data version, 0
Type: number
const for offset to crc in record, 28
Type: number
const for size of fixed header part of record, 40
Type: number
const for fdsn prefix for extra headers, FDSN
Type: string
const for little endian, true
Type: boolean
parse arrayBuffer into an array of XSeedRecords.
(ArrayBuffer)
bytes to extract xseed records from
Array<XSeedRecord>
:
array of all xseed records contained in the buffer
Represents a xSEED Data Record, with header, extras and data.
(XSeedHeader)
xseed fixed record header
(any)
json compatible object with extra headers
(DataView)
waveform data, in correct compression for value in header
Parses an xseed data record from a DataView.
(DataView)
bytes to parse
XSeedRecord
:
parsed record
Type: XSeedHeader
Type: any
Calculates the byte size of the xseed record to hold this data.
any
:
size in bytes
Decompresses the data , if the compression type is known
any
:
decompressed data as a typed array, usually Int32Array or Float32Array
Wraps data in an EncodedDataSegment for future decompression.
any
:
waveform data
Just the header.identifier, included as codes() for compatiblility with parsed miniseed2 data records.
any
:
string identifier
Fixed header of an XSeed data record.
Parses an xseed fixed header from a DataView.
(DataView)
bytes to parse
XSeedHeader
:
parsed header object
Type: any
Type: moment
Type: moment
Calculates size of the fixed header including the identifier, but without the extra headers.
any
:
size in bytes of fixed header
Converts start time header fields to ISO8641 time string.
any
:
iso start time
Converts header start time to moment
moment
:
start time as moment
Parses extra headers as json.
(DataView)
json bytes as DataView
any
:
json object
Creates a string version of a number with zero prefix padding. For example padZeros(5, 3) is 005.
any
:
zero padded string
creates a string from bytes in a DataView.
(DataView)
data bytes
(number)
offset to first byte to use
(number)
number of bytes to convert
string
:
string resulting from utf-8 conversion
Checks if two xseed records are (nearly) contiguous.
(XSeedRecord)
first record
(XSeedRecord)
second record
(number
= 1.5
)
tolerence expressed as ratio of sample period, default 1.5
boolean
:
true if contiguous
concatentates a sequence of XSeedRecords into a single seismogram object. Assumes that they are all contiguous (no gaps or overlaps) and in order. Header values from the first XSeedRecord are used.
(Array<XSeedRecord>)
array of xseed records
SeismogramSegment
:
seismogram segment for the records
Merges xseed records into a Seismogram object, each of which consists of SeismogramSegment objects containing the data as EncodedDataSegment objects. DataRecords are sorted by startTime. This assumes all data records are from the same channel, byChannel can be used first if multiple channels may be present. Gaps may be present.
(Array<XSeedRecord>)
list of xseed records to convert
Seismogram
:
the seismogram
splits a list of data records by channel identifier, returning an object with each NSLC mapped to an array of data records.
(Array<XSeedRecord>)
array of xseed records
Map<string, Array<XSeedRecord>>
:
map of channel id to array of xseed records, possibly not contiguous
splits the XSeedRecords by channel and creates a single Seismogram for each channel.
(Array<XSeedRecord>)
XSeedRecords array
Array<Seismogram>
:
Map of code to Seismogram
Convert array of Miniseed2 DataRecords into an array of XSeedRecords.
(Array<DataRecord>)
array of DataRecords
Array<XSeedRecord>
:
array of XSeedRecords
Converts a single miniseed2 DataRecord into a single XSeedRecord.
(DataRecord)
Miniseed2 DataRecord to convert
XSeedRecord
:
XSeedRecord
Copy from https://github.com/ashi009/node-fast-crc32c/blob/master/impls/js_crc32c.js and modify to use ArrayBuffer. Rename calculateCRC32C
This code is a manual javascript translation of c code generated by pycrc 0.7.1 (http://www.tty1.net/pycrc/). Command line used: './pycrc.py --model=crc-32c --generate c --algorithm=table-driven'
((ArrayBuffer | Uint8Array))
input data
(number
= 0
)
starting value, from earlier data
any
:
calculated crc32c value
Convert crc as a number into a hex string.
(number)
crc as a number
string
:
hex representation