Learn R Programming

IRISMustangMetrics (version 1.0.0)

MultipleTimeValueMetric-class: Class "MultipleTimeValueMetric"

Description

A container for metrics consisting of a vector of POSIXct datetimes. This information is used to create XML that is then submitted to the MUSTANG Backend Storage System (BSS).

Arguments

Objects from the Class

Objects can be created by calls of the form:

new("MultipleTimeValueMetric", snclq, starttime, endtime, metricName, values)

Lists of MultipleTimeValueMetric objects are returned by various metrics functions in this package.

See Also

upDownTimesMetric

Examples

Run this code
# 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","","VEA",starttime,endtime)

# Make sure we're working with a single snclq
unique_ids <- uniqueIds(st)
if (length(unique_ids) > 1) {
  stop(paste("meanMetric: Stream has",unique_ids,"unique identifiers"))
}
snclq <- unique_ids[1]

# get the upDownTimes with a minimum signal length and minimum gap (secs)
upDownTimes <- getUpDownTimes(st, min_signal=30, min_gap=60)
  
# Create and return a MultipleTimeValue metric from the upDownTimes
m <- new("MultipleTimeValueMetric", snclq=snclq,
         starttime=starttime, endtime=endtime,
         metricName="up_down_times", values=upDownTimes)

# Show the results
show(m)

Run the code above in your browser using DataLab