SingleValueMetric-class {IRISMustangMetrics} | R Documentation |
Class "SingleValueMetric"
Description
A container for metrics results and associated metadata. This information is used to create XML that is
then submitted to the MUSTANG Backend Storage System (BSS). This has been superceded by GeneralValueMetric
and is no longer in use.
Objects from the Class
Objects can be created by calls of the form:
new("SingleValueMetric", snclq, starttime, endtime, metricName, value)
Lists of SingleValueMetric
objects are returned by various metrics functions in this package.
Slots
snclq
:Object of class
"character"
: SNCLQ identifier.metricName
:Object of class
"character"
: Name of the metric.starttime
:Object of class
"POSIXct"
: Start time.endtime
:Object of class
"POSIXct"
: End time.valueName
:Object of class
"character"
: Name of the XML value identifier (default="value"
).value
:Object of class
"numeric"
: Metric value.valueString
:Object of class
"character"
: String representation of the metric value.quality_flag
:Object of class
"numeric"
: Quality flag.quality_flagString
:Object of class
"character"
: String representation of quality flag.attributeName
:Object of class
"character"
: Name of one or more optional attributes.attributeValueString
:Object of class
"character"
: String representation of one or more attribute values.
Methods
- show
signature(object = "SingleValueMetric")
: Prettyprints the information in theSingleValueMetric
Note
The starttime
and endtime
slots are typically associated with the user requested times
which may not match up with the
starttime
associated with the first Trace
and the endtime
associated with last Trace
in the Stream
object being analyzed. This ensures that
metrics results for a single time period but covering many stations or channels will have the same date range and
improves performance of the BSS which expects XML of the following form:
<measurements> <date start='2012-02-10T00:00:00.000' end='2012-02-10T09:20:00.000'> <target snclq='N.S.L.C1.Q'> <example value='1.0'/> </target> <target snclq='N.S.L.C2.Q'> <example value='2.0'/> </target> <target snclq='N.S.L.C3.Q'> <example value='3.0'/> </target> </date> </date> </measurements>
The quality_flag
is an optional value available for storing information related to the
processing of a particular metric. Its meaning will vary from metric to metric.
For an IRIS/DMC specific example, the station_completeness
metric obtains a list of available channels
for a station from the availability web service and compares this list with the list of percent_availability
metrics for this station stored in the MUSTANG BSS. In the case of the station_completeness
metric, the
quality_flag
is set to the number of channels that should be available but for whom no percent_availability
measure is obtained form the BSS.
The attributeName
and attributeValueString
slots can be used to store additional attributes associated with a metric values. For example, the max_stalta
value for a seismic trace can be calculated and a metric can be created that contains this value and another attribute with a string representation of the time at which this maximum occurred.
Author(s)
Jonathan Callahan jonathan@mazamascience.com
Examples
## Not run:
# 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 <- basicStatsMetric(st)
show(metricList[[1]])
## End(Not run)