MINISEED_MIME

src/miniseed.js
MINISEED_MIME

Type: string

parseDataRecords

src/miniseed.js

parse arrayBuffer into an array of DataRecords.

parseDataRecords(arrayBuffer: ArrayBuffer): Array<DataRecord>
Parameters
arrayBuffer (ArrayBuffer) bytes to parse
Returns
Array<DataRecord>: arry of data records

parseSingleDataRecord

src/miniseed.js

parse a single DataRecord starting at the beginning of the DataView. Currently only some blockettes are parsed, 100, 1000, 1001, others are separated, but left as just a DataView.

parseSingleDataRecord(dataView: DataView): DataRecord
Parameters
dataView (DataView) bytes as DataView
Returns
DataRecord: data record

parseSingleDataRecordHeader

src/miniseed.js

parse the DataHeader from a single DataRecord starting at the beginning of the DataView.

parseSingleDataRecordHeader(dataView: DataView): DataHeader
Parameters
dataView (DataView) bytes as DataView
Returns
DataHeader: data record header

parseBlockette

src/miniseed.js

parses a Blockette within the DataView.

parseBlockette(dataView: DataView, offset: number, length: number, headerByteSwap: boolean): Blockette
Parameters
dataView (DataView) containing the data
offset (number) offset into the DataView to start
length (number) size in bytes of the Blockette
headerByteSwap (boolean) true if byte swapping is needed
Returns
Blockette: Blockette instance

Represents a SEED Data Record, with header, blockettes and data.

new DataRecord(header: DataHeader, data: DataView)
Parameters
header (DataHeader)
data (DataView)
Instance Members
header
decompress()
asEncodedDataSegment()
codes(sep?)

Represents the header part of the DataRecord, including all the actual fixed header plus fields pulled from a blockette 1000 if present.

new DataHeader()
Instance Members
typeCode
continuationCode
staCode
locCode
chanCode
netCode
startBTime
numSamples
encoding
littleEndian
sampRateFac
sampRateMul
sampleRate
activityFlags
ioClockFlags
dataQualityFlags
numBlockettes
timeCorrection
dataOffset
blocketteOffset
recordSize
blocketteList
startTime
endTime
toString()
calcSampleRate()
timeOfSample(i)
new Blockette(type: number, body: DataView)
Parameters
type (number)
body (DataView)
Instance Members

Blockette1000

src/miniseed.js
new Blockette1000(type: number, body: DataView, encoding: number, dataRecordLengthByte: number, wordOrder: number)

Extends Blockette

Parameters
type (number)
body (DataView)
encoding (number)
dataRecordLengthByte (number)
wordOrder (number)
Instance Members
encoding
dataRecordLengthByte
wordOrder

Blockette1001

src/miniseed.js
new Blockette1001(type: number, body: DataView, timeQual: number, microsecond: number, frameCount: number)

Extends Blockette

Parameters
type (number)
body (DataView)
timeQual (number)
microsecond (number)
frameCount (number)
Instance Members
timeQual
microsecond
frameCount

Blockette100

src/miniseed.js
new Blockette100(type: number, body: DataView, sampleRate: number, flags: number)

Extends Blockette

Parameters
type (number)
body (DataView)
sampleRate (number)
flags (number)
Instance Members
sampleRate
flags
parseBTime(dataView: DataView, offset: number, byteSwap: boolean?): BTime
Parameters
dataView (DataView)
offset (number)
byteSwap (boolean?)
Returns
BTime
new BTime(year: number, jday: number, hour: number, min: number, sec: number, tenthMilli: number)
Parameters
year (number)
jday (number)
hour (number)
min (number)
sec (number)
tenthMilli (number)
Instance Members
year
jday
hour
tenthMilli
microsecond
length
toString()
toMoment()

checkByteSwap

src/miniseed.js

Sanity checks on a BTime to see if a record might be in the wrong byte order and so need to be byte swapped before parsing. Checks year betwee 1960 and 2055.

checkByteSwap(bTime: BTime): boolean
Parameters
bTime (BTime) time
Returns
boolean: true is byte order appears to be wrong, false if it seems ok

areContiguous

src/miniseed.js

Determines if two DataRecords are contiguous, ie if the second starts after the end of the first and the start time of the second is within 1.5 times the sample period of the end of the first.

areContiguous(dr1: DataRecord, dr2: DataRecord): boolean
Parameters
dr1 (DataRecord) first data record
dr2 (DataRecord) seconds data record
Returns
boolean: true if contiguous

createSeismogramSegment

src/miniseed.js

Concatentates a sequence of DataRecords into a single seismogram object. Assumes that they are all contiguous and in order. Header values from the first DataRecord are used.

createSeismogramSegment(contig: (Array<DataRecord> | DataRecord)): SeismogramSegment
Parameters
contig ((Array<DataRecord> | DataRecord)) array of data records
Returns
SeismogramSegment: SeismogramSegment instance

Merges data 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<DataRecord>): Seismogram
Parameters
drList (Array<DataRecord>) array of data records
Returns
Seismogram: Seismogram instance

Splits a list of data records by channel code, returning a Map with each NSLC string mapped to an array of data records.

byChannel(drList: Array<DataRecord>): Map<string, Array<DataRecord>>
Parameters
drList (Array<DataRecord>) array of data records
Returns
Map<string, Array<DataRecord>>: map of arrays of data records keyed by channel

seismogramPerChannel

src/miniseed.js

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

seismogramPerChannel(drList: Array<DataRecord>): Array<Seismogram>
Parameters
drList (Array<DataRecord>) DataRecords array
Returns
Array<Seismogram>: Array of Seismogram