The getAvailability
method obtains channel metadata for available channels from the EarthScope
station
web service and returns it in a dataframe.
getAvailability(obj, network, station, location, channel,
starttime, endtime, includerestricted,
latitude, longitude, minradius, maxradius)
A dataframe with the following columns:
network, station, location, channel, latitude, longitude, elevation,
depth, azimuth, dip, instrument, scale, scalefreq, scaleunits,
samplerate, starttime, endtime, snclId
Rows are ordered by snclId
.
The snclId column, eg. "US.OCWA..BHE", is generated as a convenience. It is not part of the normal return from the station web service.
Note: The snclId
is not a unique identifier. If the time span of interest
crosses an epoch boundary where instrumentation was changed then multiple records (rows)
will share the same snclId
.
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 (default=FALSE
)
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
Jonathan Callahan jonathan@mazamascience.com
The getAvailability
method uses the station web service to obtain data for all
available channels that meet the criteria defined by the arguments
and returns that data in a dataframe. Each row of the dataframe represents a unique channel-epoch.
This method is equivalent to the getChannel
method with the following additional parameters attached to the url:
&includeavailability=true&matchtimeseries=true
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 non-available channels use getUnavailability
.)
For more details see the web service documentation.
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
, getChannel
, getUnavailability
# 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 getEvent web service to retrieve events 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],]
# Find all BHZ channels collecting data at the time of the quake and within
# 5 degrees of the quake epicenter
result <- try(channels <- getAvailability(iris,"*","*","*","BHZ",starttime,endtime,
lat=e$latitude,long=e$longitude,maxradius=5))
if (inherits(result,"try-error")) {
message(geterrmessage())
} else {
channels
}
}
Run the code above in your browser using DataLab