MINISEED_THREE_MIME

dist/mseed3.mjs
MINISEED_THREE_MIME

Type: string

UNKNOWN_DATA_VERSION

dist/mseed3.mjs

const for unknown data version, 0

UNKNOWN_DATA_VERSION

Type: number

const for offset to crc in record, 28

CRC_OFFSET

Type: number

FIXED_HEADER_SIZE

dist/mseed3.mjs

const for size of fixed header part of record, 40

FIXED_HEADER_SIZE

Type: number

FDSN_PREFIX

dist/mseed3.mjs

const for fdsn prefix for extra headers, FDSN

FDSN_PREFIX

Type: string

LITTLE_ENDIAN

dist/mseed3.mjs

const for little endian, true

LITTLE_ENDIAN

Type: boolean

const for big endian, false

BIG_ENDIAN

Type: boolean

toMSeed3(seis: any, extraHeaders: any)
Parameters
seis (any)
extraHeaders (any)

parseMSeed3Records

dist/mseed3.mjs

parse arrayBuffer into an array of MSeed3Records.

parseMSeed3Records(arrayBuffer: any): any
Parameters
arrayBuffer (any) bytes to extract miniseed3 records from
Returns
any: array of all miniseed3 records contained in the buffer

mightBeMSeed3Records

dist/mseed3.mjs

parse arrayBuffer into an array of MSeed3Records.

mightBeMSeed3Records(arrayBuffer: any): any
Parameters
arrayBuffer (any) bytes to extract miniseed3 records from
Returns
any: array of all miniseed3 records contained in the buffer

MSeed3Record

dist/mseed3.mjs

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

new MSeed3Record(header: any, extraHeaders: any, rawData: any)
Parameters
header (any) miniseed3 fixed record header
extraHeaders (any) json compatible object with extra headers
rawData (any) waveform data, in correct compression for value in header
Static Members
parseSingleDataRecord(dataView)
Instance Members
calcSize()
getSize()
decompress()
asEncodedDataSegment()
codes()
getSourceId()
save(dataView)
calcCrc()
toString()

MSeed3Header

dist/mseed3.mjs

Fixed header of an MSeed3 data record.

new MSeed3Header()
Static Members
createFromDataView(dataView)
Instance Members
sampleRate
samplePeriod
getSize()
encodingName()
toString()
startFieldsInUtilFormat()
getStartFieldsAsISO(trimMicroNano)
setStart(starttime)
timeOfSample(i)
save(dataView, offset, zeroCrc)
startAsDateTime()

parseExtraHeaders

dist/mseed3.mjs

Parses extra headers as json.

parseExtraHeaders(dataView: any): any
Parameters
dataView (any) json bytes as DataView
Returns
any: json object

Creates a string version of a number with zero prefix padding. For example padZeros(5, 3) is 005.

padZeros(val: any, len: any): any
Parameters
val (any) number to stringify
len (any) total length of string
Returns
any: zero padded string

creates a string from utf-8 bytes in a DataView.

makeString(dataView: any, offset: any, length: any): any
Parameters
dataView (any) data bytes
offset (any) offset to first byte to use
length (any) number of bytes to convert
Returns
any: string resulting from utf-8 conversion

areContiguous

dist/mseed3.mjs

Checks if two miniseed3 records are (nearly) contiguous.

areContiguous(dr1: any, dr2: any, sampRatio: any): any
Parameters
dr1 (any) first record
dr2 (any) second record
sampRatio (any = 1.5) tolerence expressed as ratio of sample period, default 1.5
Returns
any: true if contiguous

createSeismogramSegment

dist/mseed3.mjs

Concatentates a sequence of MSeed3 Records into a single seismogram object. Assumes that they are all contiguous (no gaps or overlaps) and in order. Header values from the first MSeed3 Record are used.

createSeismogramSegment(contig: any): any
Parameters
contig (any) array of miniseed3 records
Returns
any: seismogram segment for the records

Merges miniseed3 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.

merge(drList: any): any
Parameters
drList (any) list of miniseed3 records to convert
Returns
any: the seismogram

mergeSegments

dist/mseed3.mjs

merges contiguous MSeed3Record into SeismogramSegments.

mergeSegments(drList: any): any
Parameters
drList (any) array of data records
Returns
any: array of SeismogramSegments for contiguous data

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

byChannel(drList: any): any
Parameters
drList (any) array of miniseed3 records
Returns
any: map of channel id to array of miniseed3 records, possibly not contiguous

seismogramSegmentPerChannel

dist/mseed3.mjs

splits the records by channel and creates a single SeismogramSegment for each contiguous window from each channel.

seismogramSegmentPerChannel(drList: any): any
Parameters
drList (any) MSeed3Records array
Returns
any: Array of SeismogramSegment

seismogramPerChannel

dist/mseed3.mjs

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

seismogramPerChannel(drList: any): any
Parameters
drList (any) MSeed3Records array
Returns
any: Map of code to Seismogram

sddPerChannel

dist/mseed3.mjs

splits the MSeed3Records by channel and creates a single SeismogramDisplayData for each channel. BAG extra headers are extracted and Quake and Markers are created.

sddPerChannel(drList: any): any
Parameters
drList (any) MSeed3Records array
Returns
any: Map of code to Seismogram

convertMS2toMSeed3

dist/mseed3.mjs

Convert array of Miniseed2 DataRecords into an array of MSeed3Records.

convertMS2toMSeed3(mseed2: any): any
Parameters
mseed2 (any) array of DataRecords
Returns
any: array of MSeed3Records

convertMS2Record

dist/mseed3.mjs

Converts a single miniseed2 DataRecord into a single MSeed3Record.

convertMS2Record(ms2record: any): any
Parameters
ms2record (any) Miniseed2 DataRecord to convert
Returns
any: MSeed3Record

calculateCRC32C

dist/mseed3.mjs

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 (https://www.tty1.net/pycrc/). Command line used: './pycrc.py --model=crc-32c --generate c --algorithm=table-driven'

calculateCRC32C(buf: any, initial: any): any
Parameters
buf (any) input data
initial (any = 0) starting value, from earlier data
Returns
any: calculated crc32c value

crcToHexString

dist/mseed3.mjs

Convert crc as a number into a hex string.

crcToHexString(crc: any): any
Parameters
crc (any) crc as a number
Returns
any: hex representation