traveltime: Access the 'traveltime' Web Service for traveltime...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

From [1]: The traveltime webservice calculates travel-times for seismic phases using a 1-D spherical earth model. There are two ways to perform this computation: (1) ws.ttDistances for epicentral distances (in decimal degrees, or kilometers), and (2) ws.ttStaSrc for station/source pairs of latitudes and longitudes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ws.ttDistances(distances, distance.units = c("degrees", "kilometers"),
  depth = 0, model = c("iasp91", "prem", "ak135"), phases = NULL,
  filename = NULL, no.header = FALSE, traveltime.only = FALSE,
  rayparam.only = FALSE, mintime.only = FALSE, verbose = TRUE)

PS_time.distances(distances, agg.fun = mean, ...)

ws.ttDeg(distances, ...)

ttDeg.ws(distances, ...)

ws.ttKm(distances, ...)

ttKm.ws(distances, ...)

ws.ttStaSrc(event.latlon, station.latlons, depth = 0, model = c("iasp91",
  "prem", "ak135"), phases = NULL, filename = NULL, no.header = FALSE,
  traveltime.only = FALSE, rayparam.only = FALSE, mintime.only = FALSE,
  verbose = TRUE)

ttStaSrc.ws(event.latlon, station.latlons, depth = 0, model = c("iasp91",
  "prem", "ak135"), phases = NULL, filename = NULL, no.header = FALSE,
  traveltime.only = FALSE, rayparam.only = FALSE, mintime.only = FALSE,
  verbose = TRUE)

PS_time.stations(event.latlon, station.latlons, agg.fun = mean, ...)

.llpair(X, verbose = TRUE)

Arguments

distances

numeric; great-circle distance from source to station. Specify multiple distances as a vector (e.g., c(1,20,30))

distance.units

character; the units of distances, either in decimal degrees or kilometers.

depth

numeric; the depth of the event, in kilometers. Note that currently only one depth can be specified.

model

character; Name of 1-D earth velocity model to be used. Available models include: iasp91 by the Int'l Assoc of Seismology and Physics of the Earth's Interior, prem the Preliminary Reference Earth Model, and ak135 by Kennett B.L.N., Engdahl E.R. and Buland R. (1995). See [2].

phases

character; Comma separated list of phases, defaulting to p,s,P,S, Pn,Sn,PcP,ScS, Pdiff,Sdiff,PKP, SKS,PKiKP,SKiKS, PKIKP,SKIKS. See Note (1).

filename

NA for an auto-generated filename based on the inputs; NULL for a temporary filename; or, a character string of the user's choosing. See Details for details about the auto-generated name.

no.header

logical; suppresses header from the resulting table

traveltime.only

logical; returns a space-separated list of travel times, in seconds. See Note (2).

rayparam.only

logical; will return a space-separated list of ray parameters, in sec/deg.

mintime.only

logical; will only retrieve the first arrival of each phase for each distance

verbose

logical; should messages be given?

agg.fun

function for data aggregation: i.e. mean, min, or max

...

additional parameters to ws.ttDistances

event.latlon

numeric; the lat/lon of the eqarthquake epicenter

station.latlons

numeric; the lat(s)/lon(s) of the stations. See X.

X

numeric; the lat(s)/lon(s) of the stations; these can be specified as a single vector with latitudes and longitudes concatenated; or (preferrably), a list or data.frame. .llpair is used to form the lat/lon pairs in the format acceptable to IRIS WS

Details

For distance calculations ws.ttDistances is the primary function; both ws.ttDeg and ws.ttKm are wrapper functions for calculations using degrees and kilometers, respectively.

For station/source pair calculations ws.ttStaSrc is the primary function.

Note that ttDeg.ws is simply a pointer to ws.ttDeg and similarly for ttKm.ws and ttStaSrc.ws.

The query is generated with constructor2, and executed with query.iris, which throws errors based on check.query.

Filename options (filename=)

Autogenerated files are of the form:

iriswsQ.<calculation type>.<model>.tt where calculation type depends on the type of calculation: Dist if the calculation was based on distances, or StaSrc if based on station-source pairs.

Temporary files are generated within query.iris.

Utility functions

PS_time functions: return P- and S-wave data and the difference between the S and P information. More specifically, PS_time.distances does this using ws.ttDistances and phases=c("P","S"); hence, distance units are in decimal degrees (by default) but can be modified through the additional parameters ....

Notes

From [1]:

  1. Valid arbitrary phases can be made up e.g. sSKJKP, but invalid phases will be ignored.

  2. Travel times are produced in ascending time order regardless of the order in which the phases are specified.

Also note that one can specify a specific phase velocity by adding 'kmps' after the desired velocity (in km/s) [3]. For example '4.4kmps' will return the principal G-phases.

Warnings

Value

A list (invisibly) with the query string, and data from the result

Author(s)

AJ Barbour

References

[1] http://service.iris.edu/irisws/traveltime/1/

[2] http://www.iris.edu/dms/products/emc-referencemodels/ describes the spherical-Earth reference models.

[3] http://www.seis.sc.edu/TauP/ is the engine used for the computations.

See Also

Other WebServices: distaz, flinnengdahl, irisws-webservices, resp, timeseries

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Not run: 
#
# In epicentral degrees
wsdeg1 <- ws.ttDistances(c(0,10,20,30,40), verbose=TRUE)
wsdeg2 <- ws.ttDeg(c(0,10,20,30,40), verbose=TRUE)
all.equal(wsdeg1, wsdeg2)
#
# In kilometers
ws.ttKm(c(0,10,20,30,40), verbose=TRUE)
#
# Get P/S wave times for distances
PS_time.distances(1:20)
PS_time.distances(1:20, distance.units="kilometers")
#
# Stations pairs:
# (fake some Lats/lons)
(ws.ttStaSrc(c(1,2),c(20,10,1:10), verbose=FALSE))
(ws.ttStaSrc(c(1,2),list(lats=1:10, lons=11:20), verbose=FALSE))
(ws.ttStaSrc(c(1,2), data.frame(lats=1:10, lons=11:20), verbose=FALSE))
#
PS_time.stations(c(10,20),1:10)
#
# Here's how the lat lon pairs are combined...
.llpair(1:10)
try(.llpair(1:11)) # success, but only because of value recycling
.llpair(data.frame(x=1:5,y=6:10))
.llpair(list(x=1:5,y=6:10))
.llpair(matrix(1:12,ncol=3))
try(.llpair(list(x=1:5,y=6:11))) # failure

## End(Not run)

abarbour/irisws documentation built on May 10, 2019, 4:07 a.m.