basicStatsMetric: Min, median, mean, rms variance, max, and number of unique...

View source: R/basicStatsMetric.R

basicStatsMetricR Documentation

Min, median, mean, rms variance, max, and number of unique values of a signal

Description

The basicStatsMetric() function calculates the min, median, mean, max, rmsVariance and number of unique values for the input seismic signal.

Usage

basicStatsMetric(st)

Arguments

st

a Stream object containing a seismic signal

Details

This metric 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

It also calculates length(unique(stmerged@traces[[1]]@data)), where stmerged is the st parameter after mergeTraces is applied to it, for the following metric:

  • sample_unique

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

Value

A list of SingleValueMetric objects is returned.

Note

See the seismic package for documentation on Stream objects and the getDataselect method.

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, inclusiveEnd=FALSE)

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

IRISMustangMetrics documentation built on April 28, 2022, 1:06 a.m.