The spikesMetric() function determines the number of spikes in a seismic
spikesMetric(st, windowSize=41, thresholdMin=10, selectivity=NA, fixedThreshold=TRUE)
The window size to roll over (default=
Initial value for outlier detection (default=
Numeric factor [0-1] used in determining outliers, or NA if fixedThreshold=TRUE (default=
TRUE or FALSE, set the threshold=thresholdMin and ignore selectivity (default=
This function uses the output of the
findOutliers() function in the seismicRoll
package to calculate the number of 'spikes' containing outliers.
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. False positives can include high frequency environmental noise.
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
selectivity will result in more outliers while a value closer to 1.0 will result in
fewer. The code ignores selectivity if
fixedThreshold is a logical
TRUE, then the threshold is set to
FALSE, then the threshold is set to maximum value of the
roll_hample() function output multiplied by the
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.
A list of
SingleValueMetric objects is returned.
thresholdMin parameter is sensitive to the data sampling rate. The default
value of 10 seems to work well with sampling rates of 10 Hz or higher ('B..' or 'H..' channels). For
'L..' channels with a sampling rate of 1 Hz
thresholdMin=12.0 or larger may be more appropriate.
More testing of spiky signals at different resolutions is needed.
See the seismicRoll package for documentation on the findOutliers() function.
Jonathan Callahan firstname.lastname@example.org
## Not run: # 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 <- show(metricList) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.