seisplotjs-model

1.2.0

Usage

Generally either

import * as model from 'seisplotjs-model'
model.xxxx

or

import * as seisplotjs from 'seisplotjs'
seisplotjs.model.xxxx

StationXML

Objects relating to stations and channels, via StationXML

new Network(networkCode: string)
Parameters
networkCode (string)
Instance Members
networkCode(value)
startDate(value)
endDate(value)
restrictedStatus(value)
description(value)
stations(value)
codes()
isTempNet()
new Station(network: Network, stationCode: string)
Parameters
network (Network)
stationCode (string)
Instance Members
network(value)
stationCode(value)
startDate(value)
endDate(value)
restrictedStatus(value)
name(value)
latitude(value)
longitude(value)
elevation(value)
channels(value)
codes()
new Channel(station: Station, channelCode: string, locationCode: string)
Parameters
station (Station)
channelCode (string)
locationCode (string)
Instance Members
station(value)
channelCode(value)
locationCode(value)
locationId(value)
startDate(value)
endDate(value)
restrictedStatus(value)
latitude(value)
longitude(value)
elevation(value)
depth(value)
azimuth(value)
dip(value)
sampleRate(value)
instrumentSensitivity(value)
response(value)
codes()
new Response(instrumentSensitivity: InstrumentSensitivity, stages: Array<Stage>)
Parameters
instrumentSensitivity (InstrumentSensitivity)
stages (Array<Stage>)
Instance Members
instrumentSensitivity(value)
stages(value)

InstrumentSensitivity

src/stationxml.js
new InstrumentSensitivity(sensitivity: number, frequency: number, inputUnits: string, outputUnits: string)
Parameters
sensitivity (number)
frequency (number)
inputUnits (string)
outputUnits (string)
Instance Members
sensitivity(value)
frequency(value)
inputUnits(value)
outputUnits(value)

AbstractFilterType

src/stationxml.js
new AbstractFilterType(inputUnits: string, outputUnits: string)
Parameters
inputUnits (string)
outputUnits (string)
Instance Members
name(value)
description(value)
inputUnits(value)
outputUnits(value)
new Stage(filter: AbstractFilterType, decimation: (Decimation | null), gain: Gain)
Parameters
decimation ((Decimation | null))
gain (Gain)
Instance Members
filter(value)
decimation(value)
gain(value)
new PolesZeros(inputUnits: string, outputUnits: string)

Extends AbstractFilterType

Parameters
inputUnits (string)
outputUnits (string)
Instance Members
pzTransferFunctionType(value)
normalizationFactor(value)
normalizationFrequency(value)
zeros(value)
poles(value)
new FIR(inputUnits: string, outputUnits: string)

Extends AbstractFilterType

Parameters
inputUnits (string)
outputUnits (string)
Instance Members
symmetry(value)
numerator(value)

CoefficientsFilter

src/stationxml.js
new CoefficientsFilter(inputUnits: string, outputUnits: string)

Extends AbstractFilterType

Parameters
inputUnits (string)
outputUnits (string)
Instance Members
cfTransferFunction(value)
numerator(value)
denominator(value)
new Decimation()
Instance Members
inputSampleRate(value)
factor(value)
offset(value)
delay(value)
correction(value)
new Gain()
Instance Members
value(value)
frequency(value)

QuakeXML

Objects relating to earthquakes, magnitudes, and picks, via QuakeML

Represent a QuakeML Event. Renamed to Quake as Event conflicts with other uses in javascript.

new Quake()
Instance Members
eventid(value)
publicID(value)
time(value)
latitude(value)
longitude(value)
depth(value)
description(value)
magnitude(value)
originList(value)
magnitudeList(value)
arrivals(value)
arrivalList(value)
picks(value)
pickList(value)
toString()

Represents a QuakeML Origin.

new Origin()
Instance Members
time(value)
latitude(value)
longitude(value)
depth(value)
toString()

Represents a QuakeML Magnitude.

new Magnitude(mag: number, type: string)
Parameters
mag (number)
type (string)
Instance Members
mag(value)
type(value)
toString()

Represents a QuakeML Arrival, a combination of a Pick with a phase name.

new Arrival(phase: string, pick: Pick)
Parameters
phase (string)
pick (Pick)
Instance Members
phase(value)
publicID(value)
pick(value)

Represents a QuakeML Pick.

new Pick(time: moment, networkCode: string, stationCode: string, locationCode: string, channelCode: string)
Parameters
time (moment)
networkCode (string)
stationCode (string)
locationCode (string)
channelCode (string)
Instance Members
publicID(value)
time(value)
networkCode(value)
stationCode(value)
locationCode(value)
channelCode(value)

Seismogram

Seismogram object, related to miniseed and other formats.

A Seismogram object.

new Seismogram(yArray: Array, sampleRate: number, start: moment)
Parameters
yArray (Array) array of Y sample values, ie the timeseries
sampleRate (number) sample rate of the seismogram, hertz
start (moment) start time of seismogrm as a momentjs moment in utc or a string that can be parsed
Instance Members
sampleRate(value)
start(value)
end()
numPoints()
netCode(value)
networkCode(value)
staCode(value)
stationCode(value)
locId(value)
locCode(value)
chanCode(value)
channelCode(value)
yUnit(value)
y(value)
yAtIndex(i)
timeOfSample(i)
codes()
seisId()
clone()

Utility

Misc utility functions and other odds and ends.

knownDataCenters

src/knownDataCenters.js
knownDataCenters
Static Members
knownDataCentersJsonURL
allDCTypes
getDefaultDC(type)
getKnownDataCenters()
updateKnownDataCenters()
getDataCenter(id)
doesSupport(dc, type)
serviceHost(dc, type)
servicePort(dc, type)

ComplexType

src/util.js
ComplexType

Type: {real: number, imag: number}

Properties
real (number)
imag (number)

createComplex

src/util.js
createComplex(real: number, imag: number): ComplexType
Parameters
real (number)
imag (number)
Returns
ComplexType
moment
hasArgs(value: any): boolean
Parameters
value (any)
Returns
boolean

hasNoArgs

src/util.js
hasNoArgs(value: any): boolean
Parameters
value (any)
Returns
boolean

isStringArg

src/util.js
isStringArg(value: any): boolean
Parameters
value (any)
Returns
boolean

isNumArg

src/util.js
isNumArg(value: any): boolean
Parameters
value (any)
Returns
boolean

stringify

src/util.js

String representation of input. THis is kind of dumb but makes flow happier.

stringify(value: any): string
Parameters
value (any)
Returns
string

checkStringOrDate

src/util.js

converts the input value is a moment, throws Error if not a string, Date or moment.

checkStringOrDate(d: any): moment
Parameters
d (any)
Returns
moment

toIsoWoZ

src/util.js

converts to ISO8601 but removes the trailing Z as FDSN web services do not allow that.

toIsoWoZ(date: moment): string
Parameters
date (moment)
Returns
string
isDef(v: any): boolean
Parameters
v (any)
Returns
boolean

Other

Stuff I forgot to put in the TOC.