
The getStation
method obtains station metadata from the IRIS DMC station web service
and returns it in a dataframe.
getStation(obj, network, station, location, channel,
starttime, endtime, includerestricted,
latitude, longitude, minradius, maxradius)
IrisClient
object
character string with the two letter seismic network code
character string with the station code
character string with the location code
character string with the three letter channel code
POSIXct class specifying the starttime (GMT)
POSIXct class specifying the endtime (GMT)
optional logical identifying whether to report on restricted data
optional latitude used when specifying a location and radius
optional longitude used when specifying a location and radius
optional minimum radius used when specifying a location and radius
optional maximum radius used when specifying a location and radius
A dataframe with the following columns:
network, station, latitude, longitude, elevation, sitename, starttime, endtime
Rows are ordered by network-station
.
The getStation
method utilizes the station web service to obtain 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 station.
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.
The IRIS DMC station web service:
http://service.iris.edu/fdsnws/station/1/
This implementation was inspired by the functionality in the obspy get_stations() method.
http://docs.obspy.org/packages/autogen/obspy.clients.fdsn.client.Client.get_stations.html
# NOT RUN {
# Open a connection to IRIS DMC 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
events <- getEvent(iris,starttime,endtime,6.0)
events
# biggest event is Nisqually
eIndex <- which(events$magnitude == max(events$magnitude))
e <- events[eIndex[1],]
# Which stations in the US network are within 5 degrees of the quake epicenter?
stations <- getStation(iris,"US","*","*","BHZ",starttime,endtime,
lat=e$latitude,long=e$longitude,maxradius=5)
stations
# }
Run the code above in your browser using DataLab