Learn R Programming

IRISMustangMetrics (version 2.4.6)

metricList2Xml: Create XML for the BSS

Description

The metricList2Xml function converts a list of SingleValueMetrics or GeneralValueMetric into an XML structure appropriate for submitting to the MUSTANG Backend Storage System (BSS).

Usage

metricList2Xml(metricList)

Value

A character string with BSS formatted XML is returned.

Arguments

metricList

a list of SingleValueMetric or GeneralValueMetric objects.

Author

Jonathan Callahan jonathan@mazamascience.com

Details

Metrics functions return lists of SingleValueMetric or GeneralValueMetric objects. A long metricList may be built up by appending the results of different metrics functions or the same metrics function operating on different seismic signals. The list may only contain a single class (SingleValueMetric cannot be mixed with GeneralValueMetric objects). These metrics can be submitted to the BSS in a standardized XML format. (see SingleValueMetric-class)

Examples

Run this code
  if (FALSE) {
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")

# Get the waveform
starttime <- as.POSIXct("2012-01-24", tz="GMT")
endtime <- as.POSIXct("2012-01-25", tz="GMT")
st <- getDataselect(iris,"AK","PIN","","BHZ",starttime,endtime)

# Apply a metric and show the results
metricList <- stateOfHealthMetric(st)
metricList <- append(metricList, basicStatsMetric(st))
bssXml <- metricList2Xml(metricList)
  }

Run the code above in your browser using DataLab