Learn R Programming

IRISMustangMetrics (version 1.0.1)

basicStatsMetric: Min, median, mean, and rms max of a signal

Description

The basicStatsMetric() function calculates the min, median, mean, max and rms for the incoming seismic signal.

Usage

basicStatsMetric(st)

Arguments

st
a Stream object containing a seismic signal

Value

A list of SingleValueMetric objects is returned.

Details

This metric merely applies the min, median, mean and max methods of Stream objects to the st parameter to calculate the following metrics:
  • sample_min
  • sample_median
  • sample_mean
  • sample_max
  • sample_rms

Any error messages generated in the process will pass through untrapped.

Examples

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

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

# Calculate some metrics and show the results
metricList <- basicStatsMetric(st)
dummy <- lapply(metricList, show)

Run the code above in your browser using DataLab