| getNetwork | R Documentation |
The getNetwork method obtains network metadata from the EarthScope
(or other Data Center) station web service and returns it in a dataframe.
getNetwork(
obj,
network,
station,
location,
channel,
starttime,
endtime,
includerestricted,
latitude,
longitude,
minradius,
maxradius,
...)
obj |
|
network |
optional character string with the two letter seismic network code |
station |
optional character string with the station code |
location |
optional character string with the location code |
channel |
optional character string with the three letter channel code |
starttime |
optional POSIXct class specifying the starttime (GMT) |
endtime |
optional POSIXct class specifying the endtime (GMT) |
includerestricted |
optional logical identifying whether to report on
restricted data (default= |
latitude |
optional latitude used when specifying a location and radius |
longitude |
optional longitude used when specifying a location and radius |
minradius |
optional minimum radius used when specifying a location and radius |
maxradius |
optional maximum radius used when specifying a location and radius |
... |
optional other parameters passed to the station web service |
The getNetwork method utilizes the station web service to return data for
all stations that meet the criteria defined by the arguments and returns that
data in a dataframe. Each row of the dataframe represents a unique network.
Each of the arguments network, station, location or
channel may contain a valid code or a wildcard expression, e.g. "BH?"
or "*". Empty strings are converted to "*". Otherwise, the ascii string that
is used for these values is simply inserted into the web service request URL.
For more details see the web service documentation.
A dataframe with the following columns:
network, description, starttime, endtime, totalstations
Rows are ordered by network.
Jonathan Callahan jonathan@mazamascience.com
The EarthScope station web service:
https://service.earthscope.org/fdsnws/station/1/
This implementation was inspired by the functionality in the ObsPy get_stations() method.
https://docs.obspy.org/packages/autogen/obspy.clients.fdsn.client.Client.get_stations.html
IrisClient-class
# Open a connection to EarthScope webservices
iris <- new("IrisClient")
# Date of Nisqually quake
starttime <- as.POSIXct("2001-02-28",tz="GMT")
endtime <- starttime + 2*24*3600
# Use the getEvent web service to determine what events happened in this time
# period
result <- try(events <- getEvent(iris,starttime,endtime,6.0))
if (inherits(result,"try-error")) {
message(geterrmessage())
} else {
events
# biggest event is Nisqually
eIndex <- which(events$magnitude == max(events$magnitude))
e <- events[eIndex[1],]
# Which seismic networks have BHZ stations within 5 degrees of the quake
# epicenter?
result <- try(networks <- getNetwork(iris,"*","*","*","BHZ",starttime,endtime,
lat=e$latitude,lon=e$longitude,maxradius=5))
if (inherits(result,"try-error")) {
message(geterrmessage())
} else {
networks
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.