Learn R Programming

IRISMustangMetrics (version 1.0.0)

spikesMetric: Find spikes using a rolling Hampel filter

Description

The spikesMetric() function determines the number of spikes in a seismic Stream.

Usage

spikesMetric(st, windowSize, thresholdMin, selectivity)

Arguments

st
a Stream object containing a seismic signal
windowSize
The window size to roll over (default=41)
thresholdMin
Minimum value for outlier detection (default=6.0)
selectivity
Numeric factor [0-1] used in determining outliers (default=0.4)

Value

  • A list of SingleValueMetric objects is returned.

Details

This function uses the output of the findOutliers function in the seismicRoll package to calculate the number of 'spikes' containing outliers.

The thresholdMin level is similar to a sigma value for normally distributed data. Hampel filter values above 6.0 indicate a data value that is extremely unlikely to be part of a normal distribution (~ 1/500 million) and therefore very likely to be an outlier. By choosing a relatively large value for thresholdMin we make it less likely that we will generate false positives.

The selectivity is a value between 0 and 1 and is used to generate an appropriate threshold for outlier detection based on the statistics of the incoming data. A lower value for selectivity will result in more outliers while a value closer to 1.0 will result in fewer.

The total count of spikes reflects the number of outlier data points that are separated by at least one non-outlier data point. Each individual spike may contain more than one data point.

Examples

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

# Get the waveform
starttime <- as.POSIXct("2013-01-03 15:00:00", tz="GMT")
endtime <- starttime + 3600 * 3  
st <- getDataselect(iris,"IU","RAO","10","BHZ",starttime,endtime)

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

Run the code above in your browser using DataLab