Learn R Programming

IRISMustangMetrics (version 2.4.6)

getMetricsXml: 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)

Value

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

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

Author

Jonathan Callahan jonathan@mazamascience.com

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.

See Also

getBssMetricList

Examples

Run this code
# 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)}) 

Run the code above in your browser using DataLab