getMetricsXml: Retrieve measurements XML from the MUSTANG BSS

getMetricsXmlR Documentation

Retrieve measurements XML from the MUSTANG BSS

Description

The getMetricsXml method makes a request of the MUSTANG BSS (Backend Storage System) and returns a character string with the response XML.

Usage

getMetricsXml(obj, network, station, location, channel, 
                   starttime, endtime, metricName, url)

Arguments

obj

an IrisClient object

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

channel

a character string with the three letter channel code

starttime

a POSIXct class specifying the starttime (GMT)

endtime

a POSIXct class specifying the endtime (GMT)

metricName

a character string identifying the name of the metric stored in the BSS

url

optional url of the BSS measurements service

Details

The default BSS measurement service when url is not specified is:

http://service.iris.edu/mustang/measurements/1/query?

This method returns raw XML which is not that useful by itself. Users should instead use the getBssMetricList method which calls this function and returns a list _Metric objects.

Error returns from the BSS will stop evaluation and throw an error message.

Value

A character string with the XML response from the BSS is returned.

Author(s)

Jonathan Callahan jonathan@mazamascience.com

See Also

getBssMetricList

Examples

# Open a connection to IRIS DMC webservices (including the BSS)
iris <- new("IrisClient", debug=TRUE)

starttime <- as.POSIXct("2012-01-24", tz="GMT")
endtime <- as.POSIXct("2012-01-25", tz="GMT")

# Get the measurement XML
xml <- tryCatch(getMetricsXml(iris,"AK","PIN","","BHZ",
                          starttime,endtime,metricName="sample_mean",
                          url="http://service.iris.edu/mustang/measurements/1/query?"),
                error= function(e) {message(e)}) 

IRISMustangMetrics documentation built on April 28, 2022, 1:06 a.m.