UNKNOWN_DATA_VERSION

src/xseed.js

const for unknown data version, 0

UNKNOWN_DATA_VERSION

Type: number

CRC_OFFSET

src/xseed.js

const for offset to crc in record, 28

CRC_OFFSET

Type: number

FIXED_HEADER_SIZE

src/xseed.js

const for size of fixed header part of record, 40

FIXED_HEADER_SIZE

Type: number

FDSN_PREFIX

src/xseed.js

const for fdsn prefix for extra headers, FDSN

FDSN_PREFIX

Type: string

LITTLE_ENDIAN

src/xseed.js

const for little endian, true

LITTLE_ENDIAN

Type: boolean

parseXSeedRecords

src/xseed.js

parse arrayBuffer into an array of XSeedRecords.

parseXSeedRecords(arrayBuffer: ArrayBuffer)
Parameters
arrayBuffer (ArrayBuffer)

XSeedRecord

src/xseed.js

Represents a xSEED Data Record, with header, extras and data.

new XSeedRecord(header: XSeedHeader, extraHeaders: any, rawData: DataView)
Parameters
header (XSeedHeader)
extraHeaders (any)
rawData (DataView)
Static Members
createFromDataView(dataView)
Instance Members
header
rawData
rawExtraHeaders
extraHeaders
length
getSize()
decompress()
asEncodedDataSegment()
codes()
save(dataView)
calcCrc()

XSeedHeader

src/xseed.js
new XSeedHeader(dataView: DataView?)
Parameters
dataView (DataView?)
Instance Members
recordIndicator
formatVersion
flags
nanosecond
year
dayOfYear
hour
minute
second
encoding
sampleRatePeriod
sampleRate
numSamples
crc
publicationVersion
identifierLength
extraHeadersLength
identifier
extraHeaders
dataLength
start
end
getSize()
toString()
getStartFieldsAsISO()
timeOfSample(i)
save(dataView, offset, zeroCrc)
_startToMoment()

parseExtraHeaders

src/xseed.js
parseExtraHeaders(dataView: DataView)
Parameters
dataView (DataView)
padZeros(val: number, len: number)
Parameters
val (number)
len (number)

makeString

src/xseed.js
makeString(dataView: DataView, offset: number, length: number): string
Parameters
dataView (DataView)
offset (number)
length (number)
Returns
string

areContiguous

src/xseed.js
areContiguous(dr1: XSeedRecord, dr2: XSeedRecord): boolean
Parameters
dr1 (XSeedRecord)
dr2 (XSeedRecord)
Returns
boolean

createSeismogramSegment

src/xseed.js

concatentates a sequence of XSeedRecords into a single seismogram object. Assumes that they are all contiguous and in order. Header values from the first XSeedRecord are used.

createSeismogramSegment(contig: Array<XSeedRecord>): SeismogramSegment
Parameters
contig (Array<XSeedRecord>)
Returns
SeismogramSegment

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.

merge(drList: Array<XSeedRecord>): Seismogram
Parameters
drList (Array<XSeedRecord>)
Returns
Seismogram

byChannel

src/xseed.js

splits a list of data records by channel code, returning an object with each NSLC mapped to an array of data records.

byChannel(drList: Array<XSeedRecord>): Map<string, Array<XSeedRecord>>
Parameters
drList (Array<XSeedRecord>)
Returns
Map<string, Array<XSeedRecord>>

seismogramPerChannel

src/xseed.js

splits the XSeedRecords by channel and creates a single Seismogram for each channel.

seismogramPerChannel(drList: Array<XSeedRecord>): Array<Seismogram>
Parameters
drList (Array<XSeedRecord>) XSeedRecords array
Returns
Array<Seismogram>: Map of code to Seismogram

convertMS2toXSeed

src/xseed.js

Convert array of Miniseed2 DataRecords into an array of XSeedRecords.

convertMS2toXSeed(mseed2: [type]): [type]
Parameters
mseed2 ([type]) array of DataRecords
Returns
[type]: array of XSeedRecords

convertMS2Record

src/xseed.js

Converts a single miniseed2 DataRecord into a single XSeedRecord.

convertMS2Record(ms2record: DataRecord): XSeedRecord
Parameters
ms2record (DataRecord) Miniseed2 DataRecord to convert
Returns
XSeedRecord: XSeedRecord

calculateCRC32C

src/xseed.js

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'

calculateCRC32C(buf: (ArrayBuffer | Uint8Array), initial: number)
Parameters
initial (number = 0)

crcToHexString

src/xseed.js
crcToHexString(crc: number): string
Parameters
crc (number)
Returns
string