Quake

The Quake submodule was introduced in SeisBase v0.3.0 to isolate handling of discrete earthquake events from handling of continuous geophysical data. While the channel data are similar, fully describing an earthquake event requires many additional Types (objects) and more information (fields) in channel descriptors.

Types

SeisBase.Quake.EQMagType
EQMag

Earthquake magnitude container object

FieldTypeMeaning
valFloat32numeric magnitude value (note: Float32!)
scaleStringmagnitude scale (freeform)
gapFloat64azimuthal gap (°)
nstInt64number of stations used in magnitude calculation
srcStringmagnitude source
source
SeisBase.Quake.EQLocType
EQLoc

QuakeML-compliant earthquake location

FieldTypeMeaningSeisBase conventions/behavior
latFloat64latitude°N = +
lonFloat64longitude°E = +
depFloat64depthkm; down = +
dxFloat64x erroruses units of data source (typically km)
dyFloat64y erroruses units of data source (typically km)
dzFloat64z erroruses units of data source (typically km)
dtFloat64ot erroruses units of data source (typically s)
seFloat64std erroruses units of data source (typically s)
rmsFloat64rms pick erruses units of data source (typically s)
gapFloat64azimuthal gapuses units of data source (typically °)
dminFloat64min sta distuses units of data source (typically km)
dmaxFloat64max sta distuses units of data source (typically km)
nstInt64# of stations
flagsUInt8boolean flagsaccess flag[n] with >>(<<(flags,n-1),7)
datumStringgeog. datum
typStringlocation typefreeform (e.g. "centroid", "hypocenter")
sigStringsignificancefreeform (e.g. "95%", "2σ")
/ confidence
srcStringsourcefreeform (e.g. "HYPOELLIPSE", "HypoDD")

flags (0x01 = true, 0x00 = false)

  1. x fixed?
  2. y fixed?
  3. z fixed?
  4. t fixed?
source
SeisBase.Quake.EventTraceDataType
EventTraceData

A custom structure designed to describe trace data (digital seismograms) associated with a discrete event (earthquake).

EventChannel

A single channel of trace data (digital seismograms) associated with a discrete event (earthquake).

Fields: EventTraceData, EventChannel, SeisEvent.data

FieldDescription
:nNumber of channels [1]
:idChannel id. Uses NET.STA.LOC.CHA format when possible
:nameFreeform channel name
:locLocation (position) vector; any subtype of InstrumentPosition
:fsSampling frequency in Hz; fs=0.0 for irregularly-sampled data.
:gainScalar gain
:respInstrument response; any subtype of InstrumentResponse
:unitsString describing data units. UCUM standards are assumed.
:azSource azimuth
:bazBackazimuth to source
:distSource-receiver distance
:phaSeismic phase catalog
:srcFreeform string describing data source.
:miscDictionary for non-critical information.
:notesTimestamped notes; includes automatically-logged information.
:tMatrix of time gaps in integer μs, formatted [Sample# Length]
:xTime-series data
  1. Not present in EventChannel objects.

See also: PhaseCat, SeisPha, SeisData

source
SeisBase.Quake.SeisEventType
SeisEvent

A structure for discrete seismic events, comprising three structures:

  • :hdr, a SeisHdr for the event descriptor
  • :source, a SeisSrc for descrition of the seismic source process
  • :data, an EventTraceData structure for channel data, including phases

See also: SeisHdr, SeisSrc, EventTraceData

source
SeisBase.Quake.SeisHdrType

SeisHdr: header information for seismic events

S = SeisHdr()

Initialize an empty SeisHdr object. Fields can be initialized at creation with keywords, e.g., SeisHdr(ot=DateTime("2012-01-03T03:49:45"), int=(0x02, "MMI")).

FieldDefaultTypeMeaning
id""StringEvent ID
int(0x00, "")Tuple(Intensity, Intensity Scale)
loc()EQLocHypocenter data
mag()EQMagMagnitude data
misc()Dict{String,Any}()Non-essential info
ot(unix epoch)DateTimeOrigin time
notes[]Array{String,1}Timestamped notes, logging
src""StringData source (URL/filename)
typ""StringEvent type

See also: EQLoc, EQMag

source
SeisBase.Quake.SeisPhaType
SeisPha()

IRIS-style seismic phase and pick container

FieldTypeMeaningSeisBase conventions/behavior
ampFloat64amplitudeuses units of data source
dFloat64distanceno unit conversion; can be m, km, or °
iaFloat64incidence angleuses units of data source
resFloat64pick residual
rpFloat64ray parameter
taFloat64takeoff angle
ttFloat64travel time
uncFloat64uncertainty
polCharpolarity
qualCharpick qualitynot (re)calculated
source
SeisBase.Quake.SeisSrcType

SeisSrc: container for descriptions of a seismic source process

S = SeisSrc()

Initialize an empty SeisSrc object. Fields can be initialized at creation with keywords; for example, S = SeisSrc(m0 = 1.6e22).

FieldTypeMeaning
idStringsource process ID
eidStringevent ID (note, generally :id != :eid)
m0Float64scalar seismic moment
mtArray{Float64,1}seismic moment tensor
dmArray{Float64,1}seismic moment tensor misfit
npolInt64number of polarities in focal mechanism
gapFloat64max azimuthal gap in focal mechanism
paxArray{Float64,2}principal axes
planesArray{Float64,2}nodal planes
srcStringdata source string (filename or URL)
stSourceTimesource-time subfield
miscDict{String,Any}dictionary of non-essential information
notesArray{String,1}notes and automated logging

See also: EQLoc, EQMag, SourceTime

source
SeisBase.Quake.SourceTimeType
SourceTime()

QuakeML-compliant seismic source-time parameterization.

FieldTypeMeaningSeisBase conventions/behavior
descStringdescription
durFloat64duration
riseFloat64rise time
decayFloat64decay time
source

Web Queries

Keyword descriptions for web queries appear at the end of this section.

SeisBase.Quake.FDSNevqFunction
(H,R) = FDSNevq(ot)

Multi-server query for the events with the closest origin time to ot. Returns an Array{SeisHdr,1} in H with event headers and an Array{SeisSrc,1} in R in H with corresponding source process info.

Keywords

KWDefaultT [1]Meaning
evw[600., 600.]Float64search window in seconds [2]
mag[6.0, 9.9]Float64search magitude range
nev0Integerevents per query [3]
rad[]Float64radius search
reg[]Float64geographic search region
src [4]"IRIS"Stringdata source; ?seis_www lists
to30Int64timeout (s) for web requests
v0Integerverbosity
  1. Array{T, 1} for evw, mag, rad, reg; T for others
  2. search range is always ot-|evw[1]| ≤ t ≤ ot+|evw[2]|
  3. if nev=0, all matches are returned.
  4. In an event query, keyword src can be a comma-delineated list, like "IRIS, INGV, NCEDC".

Notes

  • Specify ot as a string formatted YYYY-MM-DDThh:mm:ss in UTC (e.g. "2001-02-08T18:54:32").
  • Incomplete string queries are read to the nearest fully-specified time constraint; thus, FDSNevq("2001-02-08") returns the nearest event to 2001-02-08T00:00:00.
  • If no event is found in the specified search window, FDSNevq exits with an error.
  • For FDSNevq, keyword src can be a comma-delineated list of sources, provided each has a value in ?seis_www; for example, src="IRIS, INGV, NCEDC" is valid.

See also: SeisBase.KW, ?seis_www

source
SeisBase.Quake.FDSNevtFunction
FDSNevt(ot::String, chans::String)

Get header and trace data for the event closest to origin time ot on channels chans. Returns a SeisEvent structure.

Keywords

KWDefaultT [1]Meaning
evw[600., 600.]Float64search window in seconds [2]
fmt"miniseed"Stringrequest data format
len120.0Float64desired trace length [s]
mag[6.0, 9.9]Float64search magitude range
model"iasp91"Stringvelocity model for phases
nd1Realnumber of days per subrequest
opts""Stringuser-specified options[3]
pha"P"Stringphases to get [4]
rad[]Float64radius search
reg[]Float64geographic search region
src"IRIS"Stringdata source; ?seis_www lists
to30Int64timeout (s) for web requests
v0Integerverbosity
wfalseBoolwrite requests to disk?
  1. KW is Array{T, 1} for evw, mag, rad, reg, type T for others
  2. Search range is always ot-|evw[1]| ≤ t ≤ ot+|evw[2]|
  3. Format like an http request string, e.g. "szsrecs=true&repo=realtime" for FDSN. String shouldn't begin with an ampersand.
  4. Comma-separated String, like "P, pP"; use "ttall" for all phases

Notes

  • Specify ot as a string formatted YYYY-MM-DDThh:mm:ss in UTC (e.g. "2001-02-08T18:54:32").
  • Incomplete string queries are read to the nearest fully-specified time constraint; thus, FDSNevq("2001-02-08") returns the nearest event to 2001-02-08T00:00:00.
  • If no event is found in the specified search window, FDSNevt exits with an error.
  • Unlike FDSNevq, number of events cannot be specified and src must be a single source String in ?seis_www.

See also: distaz!, FDSNevq, FDSNsta

source
SeisBase.Quake.get_pha!Function
get_pha!(Ev::SeisEvent[, keywords])

Command-line interface to IRIS online travel time calculator, which calls TauP [1-2]. Returns a matrix of strings.

Keywords:

  • pha: comma-separated String of phases ("P, S, SP")
  • model: velocity model ("iasp91")
  • to: timeout in seconds
  • v: verbosity

References

  1. TauP manual: http://www.seis.sc.edu/downloads/TauP/taup.pdf
  2. Crotwell, H. P., Owens, T. J., & Ritsema, J. (1999). The TauP Toolkit:

Flexible seismic travel-time and ray-path utilities, SRL 70(2), 154-160.

source

Web Query Keywords

KWDefaultT [1]Meaning
evw[600.0, 600.0]A{F,1}search window in seconds [2]
fmt"miniseed"Srequest data format
len120.0Idesired trace length [s]
mag[6.0, 9.9]A{F,1}magnitude range for queries
model"iasp91"SEarth velocity model for phase times
nd1Inumber of days per subrequest
nev0Inumber of events returned per query [3]
opts""Suser-specified options [4]
pha"P"Sphases to get [5]
rad[]A{F,1}radial search region [6]
reg[]A{F,1}rectangular search region [7]
src"IRIS"Sdata source; type ?seis_www for list
to30Iread timeout for web requests [s]
v0Iverbosity
wfalseBwrite requests to disk? [8]

Table Footnotes

  1. Types: A = Array, B = Boolean, C = Char, DT = DateTime, F = Float, I = Integer, S = String, U8 = Unsigned 8-bit integer (UInt8)
  2. search range is always $ot-|evw[1]| ≤ t ≤ ot+|evw[2]|$
  3. nev=0 returns all events in the query
  4. String is passed as-is, e.g. "szsrecs=true&repo=realtime" for FDSN. String should not begin with an ampersand.
  5. Comma-separated String, like "P, pP"; use "ttall" for all phases
  6. Specify region [centerlat, centerlon, minradius, maxradius, depmin, depmax], with lat, lon, and radius in decimal degrees (°) and depth in km with + = down. Depths are only used for earthquake searches.
  7. Specify region [latmin, latmax, lonmin, lonmax, depmin, depmax], with lat, lon in decimal degrees (°) and depth in km with + = down. Depths are only used for earthquake searches.
  8. If w=true, a file name is automatically generated from the request parameters, in addition to parsing data to a SeisData structure. Files are created from the raw download even if data processing fails, in contrast to get_data(... wsac=true).

Example

Get seismic and strainmeter records for the P-wave of the Tohoku-Oki great earthquake on two borehole stations and write to native SeisData format:

S = FDSNevt("201103110547", "PB.B004..EH?,PB.B004..BS?,PB.B001..BS?,PB.B001..EH?")
wseis("201103110547_evt.seis", S)

Utility Functions

SeisBase.Quake.distaz!Function
distaz!(Ev::SeisEvent)

Compute Δ, Θ by the Haversine formula.

Updates Ev.data with distance, azimuth, and backazimuth for each channel, written to Ev.data.dist, Ev.data.az, and Ev.data.baz, respectively.

source
SeisBase.Quake.gcdistFunction
G = gcdist(src, rec)

Compute great circle distance, azimuth, and backazimuth from single source s with coordinates [s_lat, s_lon] to receivers r with coordinates [r_lat r_lon].

For a single source, pass src as a Float64 vector of the form [s_lat, s_lon]; gcdist will return an Array{Float64,2} of the form

[Δ₁   θ₁   β₁
 Δ₂   θ₂   β₂
 ⋮    ⋮    ⋮
 Δn   θn   βn]

for receivers 1:n.

For multiple sources, pass src as an Array{Float64,2} with each row containing one (lat, lon) pair. This returns a three-dimensional matrix where each two-dimensional slice takes the form

  [Δᵢ₁   θᵢ₁   βᵢ₁
   ⋮     ⋮     ⋮
   Δᵢn   θᵢn   βᵢn]

for source i at receivers 1:n.

source
SeisBase.Quake.fill_sac_evh!Function
fill_sac_evh!(Ev::SeisEvent, fname::String; k=i)

Fill (overwrite) values in Ev.hdr with data from SAC file fname. Keyword k=i specifies the reference channel i from which the absolute origin time Ev.hdr.ot is set. Potentially affects header fields :id, :loc (subfields .lat, .lon, .dep), and :ot.

source

Reading Earthquake Data Files

SeisBase.read_quakeFunction
Ev = read_quake(fmt, file)

Read data in file format fmt from file into SeisEvent object Ev.

  • Formats: suds, qml, uw
  • Keywords: full, v

Note: because earthquake data are usually discrete, self-contained files, no "in-place" version of read_quake exists, and read_quake doesn't support wildcards in the file string.

Supported File Formats

File FormatStringNotes
PC-SUDSsuds
QuakeMLqml, quakemlonly reads first event from file
UWuw

See also: read_data, get_data, read_meta, UW.readuwevt

source

QuakeML