getGeneralValueMetrics {IRISMustangMetrics} | R Documentation |
Retrieve measurements from the MUSTANG BSS
Description
The getGeneralValueMetrics
method of the IrisClient
makes a request of the MUSTANG database
and returns a dataframe containing metrics measurments.
Usage
getGeneralValueMetrics(obj, network, station, location, channel,
starttime, endtime, metricName, ...)
Arguments
obj |
an |
network |
a character string with the two letter seismic network code |
station |
a character string with the station code |
location |
a character string with the location code, can be "" for wildcard all |
channel |
a character string with the three letter channel code, can be "" for wildcard all |
starttime |
a POSIXct class specifying the starttime (GMT) |
endtime |
a POSIXct class specifying the endtime (GMT) |
metricName |
a character string containing one or more comma separated metric names |
... |
optional arguments
|
Details
A blank location code should be specified as location="--"
; Using location=""
will return all location codes.
The default MUSTANG measurement service when url
is not specified is:
http://service.iris.edu/mustang/measurements/1/query?
Data returned from MUSTANG are converted into an R dataframe.
The optional constraint
parameter is used to add constraints to the query as defined
in the MUSTANG measurements web service documentation.
Any string passed in with the constraint
parameter will be appended to the request url following an ampersand.
Error returns from the BSS will stop evaluation and generate an error message.
Value
A dataframe with the following columns:
~metricName~, value, additional values, snclq, starttime, endtime, loadtime
The loadtime
column contains the time at which this record was loaded into the database.
The dataframe rows will be sorted by metricName and increasing starttime.
Author(s)
Jonathan Callahan jonathan.s.callahan@gmail.com
See Also
Examples
## Not run:
# Open a connection to IRIS DMC webservices (including the BSS)
iris <- new("IrisClient", debug=TRUE)
starttime <- as.POSIXct("2016-08-01", tz="GMT")
endtime <- starttime + 30*24*3600
metricName <- "sample_max"
# Get the measurement dataframe
juneStats <- getGeneralValueMetrics(iris,"IU","ANMO","","BH[12Z]",
starttime,endtime,metricName)
print(juneStats)
## End(Not run)