@seismo/core
Version:
This is the package for the core library of Seismo, a JavaScript library for seismic data processing and visualization. It provides utilities for handling seismic data, including FDSN web services, waveform processing, and event handling. The library is d
79 lines (78 loc) • 3.1 kB
TypeScript
export declare const FDSN_PREFIX = "FDSN:";
export declare const SEP = "_";
export declare class FDSNSourceId {
networkCode: string;
stationCode: string;
locationCode: string;
bandCode: string;
sourceCode: string;
subsourceCode: string;
constructor(networkCode: string, stationCode: string, locationCode: string, bandCode: string, sourceCode: string, subsourceCode: string);
static createUnknown(sampRate?: number, source?: string, subsource?: string): FDSNSourceId;
static parse(id: string): FDSNSourceId;
static fromNslc(net: string, sta: string, loc: string, channelCode: string): FDSNSourceId;
static fromNslcId(nslcId: NslcId): FDSNSourceId;
static parseNslc(nslc: string, sep?: string): FDSNSourceId;
stationSourceId(): StationSourceId;
networkSourceId(): NetworkSourceId;
asNslc(): NslcId;
/**
* returns a channel code. If this is an old style NSLC, it will be 3 chars,
* but if either source or subsouce is more than one char, it will be
* three fields delimited by underscores.
*
* @returns the channel code part of the id
*/
formChannelCode(): string;
toString(): string;
toStringNoPrefix(): string;
equals(other: FDSNSourceId | null): boolean;
clone(): FDSNSourceId;
}
export declare class NetworkSourceId {
networkCode: string;
constructor(networkCode: string);
static parse(id: string): NetworkSourceId;
toString(): string;
equals(other: NetworkSourceId): boolean;
}
export declare class StationSourceId {
networkCode: string;
stationCode: string;
constructor(networkCode: string, stationCode: string);
static parse(id: string): StationSourceId;
toString(): string;
networkSourceId(): NetworkSourceId;
equals(other: StationSourceId): boolean;
}
export declare class LocationSourceId {
networkCode: string;
stationCode: string;
locationCode: string;
constructor(networkCode: string, stationCode: string, locationCode: string);
toString(): string;
equals(other: LocationSourceId): boolean;
}
/**
* Generates the best band code for a channel based on the sample rate and
* optionally the response lower bound period, which is mostly useful for
* separating broadband from short period seismometers.
*
* @param sampRate sample rate in samples per second
* @param resp_lb response long period bound in seconds
* @returns single character band code
*/
export declare function bandCodeForRate(sampRate?: number, resp_lb?: number): string;
export declare const EMPTY_LOC_CODE = "--";
export declare class NslcId {
networkCode: string;
stationCode: string;
locationCode: string;
channelCode: string;
constructor(net: string, sta: string, loc: string, chan: string);
static parse(nslc: string, sep?: string): NslcId;
toString(): string;
equals(other: NslcId): boolean;
}
export declare function parseSourceId(id: string): FDSNSourceId | NetworkSourceId | StationSourceId;
export declare function SourceIdSorter(aSid: FDSNSourceId, bSid: FDSNSourceId): number;