import { DateTime } from "luxon"; import { SeismogramSegment } from "./seismogramsegment.mjs"; import { Seismogram } from "./seismogram.mjs"; import { EncodedDataSegment } from "./seedcodec.mjs"; export declare const MINISEED_MIME = "application/vnd.fdsn.mseed"; export declare const R_TYPECODE: number; export declare const D_TYPECODE: number; export declare const Q_TYPECODE: number; export declare const M_TYPECODE: number; /** * parse arrayBuffer into an array of DataRecords. * * @param arrayBuffer bytes to parse * @returns arry of data records */ export declare function parseDataRecords(arrayBuffer: ArrayBufferLike): Array; /** * 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. * * @param dataView bytes as DataView * @returns data record */ export declare function parseSingleDataRecord(dataView: DataView): DataRecord; /** * parse the DataHeader from a single DataRecord starting at the beginning of the DataView. * * @param dataView bytes as DataView * @returns data record header */ export declare function parseSingleDataRecordHeader(dataView: DataView): DataHeader; /** * parses a Blockette within the DataView. * * @param dataView containing the data * @param offset offset into the DataView to start * @param length size in bytes of the Blockette * @param headerByteSwap true if byte swapping is needed * @returns Blockette instance */ export declare function parseBlockette(dataView: DataView, offset: number, length: number, headerByteSwap: boolean): Blockette; /** * Represents a SEED Data Record, with header, blockettes and data. */ export declare class DataRecord { header: DataHeader; data: DataView; constructor(header: DataHeader, data: DataView); /** * Decompresses the data , if the compression type is known. * * @returns decompressed data */ decompress(): Int32Array | Float32Array | Float64Array; asEncodedDataSegment(): EncodedDataSegment; /** * Concatenates the net, station, loc and channel codes, * separated by the given seperator, or periods if not given. * * @param sep optional separater, defaults to . * @returns string of codes */ codes(sep?: string): string; } /** * Represents the header part of the DataRecord, including all the actual * fixed header plus fields pulled from a blockette 1000 if present. */ export declare class DataHeader { seq: string; typeCode: number; continuationCode: number; staCode: string; locCode: string; chanCode: string; netCode: string; startBTime: BTime; numSamples: number; encoding: number; littleEndian: boolean; sampRateFac: number; sampRateMul: number; sampleRate: number; activityFlags: number; ioClockFlags: number; dataQualityFlags: number; numBlockettes: number; timeCorrection: number; dataOffset: number; blocketteOffset: number; recordSize: number; blocketteList: Array; startTime: DateTime; endTime: DateTime; constructor(); toString(): string; /** * Calculates the sample rate in hertz from the sampRateFac and sampRateMul * parameters. This.sampleRate value is set to this value at construction. * * @returns sample rate */ calcSampleRate(): number; /** * Calculates the time of the i-th sample in the record, zero based, * so timeOfSample(0) is the start and timeOfSample(this.numSamples-1) is end. * * @param i sample index * @returns time at i-th sample as DateTime */ timeOfSample(i: number): DateTime; } export declare class Blockette { type: number; body: DataView; constructor(type: number, body: DataView); } export declare class Blockette1000 extends Blockette { encoding: number; dataRecordLengthByte: number; wordOrder: number; constructor(type: number, body: DataView, encoding: number, dataRecordLengthByte: number, wordOrder: number); } export declare class Blockette1001 extends Blockette { timeQual: number; microsecond: number; frameCount: number; constructor(type: number, body: DataView, timeQual: number, microsecond: number, frameCount: number); } export declare class Blockette100 extends Blockette { sampleRate: number; flags: number; constructor(type: number, body: DataView, sampleRate: number, flags: number); } export declare function parseBTime(dataView: DataView, offset: number, byteSwap?: boolean): BTime; export declare class BTime { year: number; jday: number; hour: number; min: number; sec: number; tenthMilli: number; microsecond: number; length: number; constructor(year: number, jday: number, hour: number, min: number, sec: number, tenthMilli: number); toString(): string; /** * Converts this BTime to a luxon utc DateTime. Note DateTime's precision * is limited to milliseconds and leap seconds are not supported, * ie 60 seconds returns DateTime.invalid. * * @returns BTime as a DateTime */ toDateTime(): DateTime; } /** * 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. * * @param bTime time * @returns true is byte order appears to be wrong, false if it seems ok */ export declare function checkByteSwap(bTime: BTime): boolean; /** * 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. * * @param dr1 first data record * @param dr2 seconds data record * @returns true if contiguous */ export declare function areContiguous(dr1: DataRecord, dr2: DataRecord): boolean; /** * 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. * * @param contig array of data records * @returns SeismogramSegment instance */ export declare function createSeismogramSegment(contig: Array | DataRecord): SeismogramSegment; /** * 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. It also * assumes that new seismograms should not be created for gaps, for example * when getting data from the same channel for multiple earthquakes. * * @param drList array of data records * @returns Seismogram instance */ export declare function merge(drList: Array): Seismogram; /** * merges contiguous DataRecords into SeismogramSegments. * * @param drList array of data records * @returns array of SeismogramSegments for contiguous data */ export declare function mergeSegments(drList: Array): Array; /** * Splits a list of data records by channel code, returning a Map * with each NSLC string mapped to an array of data records. * * @param drList array of data records * @returns map of arrays of data records keyed by channel */ export declare function byChannel(drList: Array): Map>; /** * splits the DataRecords by channel and creates a single * SeismogramSegment for each contiguous window from each channel. * * @param drList DataRecords array * @returns Array of SeismogramSegment */ export declare function seismogramSegmentPerChannel(drList: Array): Array; /** * splits the DataRecords by channel and creates a single * Seismogram for each channel. * * @param drList DataRecords array * @returns Array of Seismogram */ export declare function seismogramPerChannel(drList: Array): Array; //# sourceMappingURL=miniseed.d.mts.map