import { Complex } from "./oregondsputil.mjs"; import { FDSNSourceId, NetworkSourceId, StationSourceId, NslcId } from "./fdsnsourceid.mjs"; import { DateTime, Interval } from "luxon"; export declare const STAXML_MIME = "application/vnd.fdsn.stationxml+xml"; /** xml namespace for stationxml */ export declare const STAML_NS = "http://www.fdsn.org/xml/station/1"; export declare const COUNT_UNIT_NAME = "count"; export declare const FIX_INVALID_STAXML = true; export declare const INVALID_NUMBER = -99999; export declare const FAKE_START_DATE: DateTime | DateTime; /** a fake, completely empty stationxml document in case of no data. */ export declare const FAKE_EMPTY_XML = " "; export declare const CHANNEL_CLICK_EVENT = "channelclick"; export declare const STATION_CLICK_EVENT = "stationclick"; export interface ChannelEventDetail { mouseevent: Event; channel: Channel; } export interface StationEventDetail { mouseevent: Event; station: Station; } /** * Typescript guard for channelclick CustomEvents. * @param event generic event to ensure is a CustomEvent * @return true if is correct type */ export declare function isChannelClickCustomEvent(event: Event): event is CustomEvent; /** * Typescript guard for stationclick CustomEvents. * @param event generic event to ensure is a CustomEvent * @return true if is correct type */ export declare function isStationClickCustomEvent(event: Event): event is CustomEvent; /** * Utility function to create CustomEvent for clicking on a Channel, for example * in a map or table. * * @param sta Channel clicked on * @param mouseclick original mouse click Event * @returns CustomEvent populated with channel field in detail. */ export declare function createChannelClickEvent(sta: Channel, mouseclick: Event): CustomEvent; /** * Utility function to create CustomEvent for clicking on a Station, for example * in a map or table. * * @param sta Station clicked on * @param mouseclick original mouse click Event * @returns CustomEvent populated with station field in detail. */ export declare function createStationClickEvent(sta: Station, mouseclick: Event): CustomEvent; export interface StationClickEventMap extends HTMLElementEventMap { "stationclick": CustomEvent; } export interface ChannelClickEventMap extends HTMLElementEventMap { "channelclick": CustomEvent; } export declare class Network { networkCode: string; _startDate: DateTime; _endDate: DateTime | null; restrictedStatus: string; description: string; totalNumberStations: number | null; stations: Array; constructor(networkCode: string); get sourceId(): NetworkSourceId; get startDate(): DateTime; set startDate(value: DateTime | string); get endDate(): null | DateTime; set endDate(value: DateTime | string | null); get timeRange(): Interval; codes(): string; isActiveAt(d?: DateTime): boolean; isTempNet(): boolean; } export declare class Station { network: Network; stationCode: string; sourceID: string | null; /** @private */ _startDate: DateTime; /** @private */ _endDate: DateTime | null; restrictedStatus: string; name: string; latitude: number; longitude: number; elevation: number; waterLevel: number | null; comments: Array; equipmentList: Array; dataAvailability: DataAvailability | null; identifierList: Array; description: string; geology: string; vault: string; channels: Array; constructor(network: Network, stationCode: string); get sourceId(): StationSourceId; get startDate(): DateTime; set startDate(value: DateTime | string); get endDate(): DateTime | null; set endDate(value: DateTime | string | null); get timeRange(): Interval; get networkCode(): string; isActiveAt(d?: DateTime): boolean; codes(sep?: string): string; } export declare class Channel { station: Station; /** @private */ _locationCode: string; channelCode: string; /** @private */ _sourceId: FDSNSourceId | undefined; /** @private */ _startDate: DateTime; /** @private */ _endDate: DateTime | null; restrictedStatus: string; latitude: number; longitude: number; elevation: number; depth: number; azimuth: number; dip: number; sampleRate: number; waterLevel: number | null; comments: Array; equipmentList: Array; dataAvailability: DataAvailability | null; identifierList: Array; description: string; response: Response | null; sensor: Equipment | null; preamplifier: Equipment | null; datalogger: Equipment | null; constructor(station: Station, channelCode: string, locationCode: string); get sourceId(): FDSNSourceId; set sourceId(sid: FDSNSourceId); get nslcId(): NslcId; get startDate(): DateTime; set startDate(value: DateTime | string); get endDate(): null | DateTime; set endDate(value: DateTime | string | null); get timeRange(): Interval; get locationCode(): string; set locationCode(value: string); get stationCode(): string; get networkCode(): string; /** * Checks if this channel has sensitivity defined, within the response. * * @returns true if instrumentSensitivity exits */ hasInstrumentSensitivity(): boolean; set instrumentSensitivity(value: InstrumentSensitivity); get instrumentSensitivity(): InstrumentSensitivity; /** * return network, station, location and channels codes as one string. * * @returns net.sta.loc.chan */ get nslc(): string; /** * return network, station, location and channels codes as one string. * * @param sep separator, defaults to dot '.' * @returns net.sta.loc.chan */ codes(sep?: string): string; isActiveAt(d?: DateTime): boolean; } export declare class InstrumentSensitivity { sensitivity: number; frequency: number; inputUnits: string; outputUnits: string; constructor(sensitivity: number, frequency: number, inputUnits: string, outputUnits: string); } export declare class Equipment { resourceId: string; type: string; description: string; manufacturer: string; vendor: string; model: string; serialNumber: string; installationDate: DateTime | null; removalDate: DateTime | null; calibrationDateList: Array; constructor(); } export declare class Response { instrumentSensitivity: InstrumentSensitivity | null; stages: Array; constructor(instrumentSensitivity?: InstrumentSensitivity, stages?: Array); } export declare class Stage { filter: AbstractFilterType | null; decimation: Decimation | null; gain: Gain; constructor(filter: AbstractFilterType | null, decimation: Decimation | null, gain: Gain); } export declare class AbstractFilterType { inputUnits: string; outputUnits: string; name: string; description: string; constructor(inputUnits: string, outputUnits: string); } export declare class PolesZeros extends AbstractFilterType { pzTransferFunctionType: string; normalizationFactor: number; normalizationFrequency: number; zeros: Array>; poles: Array>; constructor(inputUnits: string, outputUnits: string); } export declare class FIR extends AbstractFilterType { symmetry: string; numerator: Array; constructor(inputUnits: string, outputUnits: string); } export declare class CoefficientsFilter extends AbstractFilterType { cfTransferFunction: string; numerator: Array; denominator: Array; constructor(inputUnits: string, outputUnits: string); } export declare class Decimation { inputSampleRate: number; factor: number; offset: number | null | undefined; delay: number | null | undefined; correction: number | null | undefined; constructor(inputSampleRate: number, factor: number); } export declare class Gain { value: number; frequency: number; constructor(value: number, frequency: number); } export declare class Span { interval: Interval; numberSegments: number; maximumTimeTear: number | null; constructor(interval: Interval); } export declare class DataAvailability { extent: Interval | null; spanList: Array; constructor(); } export declare class Comment { id: string | null; subject: string | null; value: string; beginEffectiveTime: DateTime | null; endEffectiveTime: DateTime | null; authorList: Array; constructor(value: string); } export declare class Author { name: string | null; agency: string | null; email: string | null; phone: string | null; } /** * Parses the FDSN StationXML returned from a query. * * @param rawXml parsed xml to extract objects from * @returns an Array of Network objects. */ export declare function parseStationXml(rawXml: Document): Array; /** * Parses a FDSNStationXML Network xml element into a Network object. * * @param xml the network xml Element * @returns Network instance */ export declare function convertToNetwork(xml: Element): Network; /** * Parses a FDSNStationXML Station xml element into a Station object. * * @param network the containing network * @param xml the station xml Element * @returns Station instance */ export declare function convertToStation(network: Network, xml: Element): Station; /** * Parses a FDSNStationXML Channel xml element into a Channel object. * * @param station the containing staton * @param xml the channel xml Element * @returns Channel instance */ export declare function convertToChannel(station: Station, xml: Element): Channel; export declare function convertToDataAvailability(xml: Element): DataAvailability; export declare function convertToComment(xml: Element): Comment; export declare function convertToAuthor(xml: Element): Author; export declare function convertToEquipment(xml: Element): Equipment; /** * Parses a FDSNStationXML Response xml element into a Response object. * * @param responseXml the response xml Element * @returns Response instance */ export declare function convertToResponse(responseXml: Element): Response; /** * Parses a FDSNStationXML InstrumentSensitivity xml element into a InstrumentSensitivity object. * * @param xml the InstrumentSensitivity xml Element * @returns InstrumentSensitivity instance */ export declare function convertToInstrumentSensitivity(xml: Element): InstrumentSensitivity; /** * Parses a FDSNStationXML Stage xml element into a Stage object. * * @param stageXml the Stage xml Element * @returns Stage instance */ export declare function convertToStage(stageXml: Element): Stage; /** * Parses a FDSNStationXML Decimation xml element into a Decimation object. * * @param decXml the Decimation xml Element * @returns Decimation instance */ export declare function convertToDecimation(decXml: Element): Decimation; /** * Parses a FDSNStationXML Gain xml element into a Gain object. * * @param gainXml the Gain xml Element * @returns Gain instance */ export declare function convertToGain(gainXml: Element): Gain; export declare function createInterval(start: DateTime, end: null | DateTime): Interval; /** * Extracts a complex number from an stationxml element. * * @param el xml element * @returns Complex instance */ export declare function extractComplex(el: Element): InstanceType; /** * Generator function to access all active stations within all networks in the array. * * @param networks array of Networks * @param atTime time for station to be active, defaults to now * @yields generator yeiding stations */ export declare function activeNetworks(networks: Array, atTime?: DateTime): Generator; /** * Generator function to access all stations within all networks in the array. * * @param networks array of Networks * @yields generator yeiding stations */ export declare function allStations(networks: Array): Generator; /** * Generator function to access all active stations within all networks in the array. * * @param networks array of Networks * @param atTime time for station to be active, defaults to now * @yields generator yeiding stations */ export declare function activeStations(networks: Array, atTime?: DateTime): Generator; /** * Generator function to access all channels within all stations * within all networks in the array. * * @param networks array of Networks * @yields generator yeiding channels */ export declare function allChannels(networks: Array): Generator; /** * Generator function to access all active channels within all networks in the array. * * @param networks array of Networks * @param atTime time for channel to be active, defaults to now * @yields generator yeiding channels */ export declare function activeChannels(networks: Array, atTime?: DateTime): Generator; /** * Extract all channels from all stations from all networks in the input array. * Regular expressions may be used instead of exact code matchs. * * @param networks Array of networks. * @param netCode network code to match, defaults to .* * @param staCode station code to match, defaults to .* * @param locCode location code to match, defaults to .* * @param chanCode channel code to match, defaults to .* * @yields Array of channels. */ export declare function findChannels(networks: Array, netCode?: string, staCode?: string, locCode?: string, chanCode?: string): Generator; export declare function findChannelsForSourceId(networks: Array, sid: FDSNSourceId): Generator; export declare function uniqueSourceIds(channelList: Iterable): Array; export declare function uniqueStations(channelList: Iterable): Array; export declare function uniqueNetworks(channelList: Iterable): Array; /** * Fetches and parses StationXML from a URL. This can be used in instances where * a static stationXML file is available on a web site instead of via a web * service with query paramters. * @param url the url to download from * @param timeoutSec timeout in case of failed connection * @param nodata http code for no data * @returns Promise to parsed StationXML as an Network array */ export declare function fetchStationXml(url: string | URL, timeoutSec?: number, nodata?: number): Promise>; export declare function mightBeStatonXml(buf: ArrayBufferLike): boolean; export declare const parseUtil: { _grabFirstEl: (xml: Element | null | void, tagName: string) => Element | null; _grabFirstElText: (xml: Element | null | void, tagName: string) => string | null; _grabFirstElFloat: (xml: Element | null | void, tagName: string) => number | null; _grabFirstElInt: (xml: Element | null | void, tagName: string) => number | null; _grabAttribute: (xml: Element | null | void, tagName: string) => string | null; _requireAttribute: (xml: Element | null | void, tagName: string) => string; _grabAttributeNS: (xml: Element | null | void, namespace: string, tagName: string) => string | null; }; //# sourceMappingURL=stationxml.d.mts.map