SNRMetric {IRISMustangMetrics} | R Documentation |
Signal to Noise Ratio
Description
The SNRMetric() function calculates the Signal-to-Noise Ratio of a seismic trace by one of several named algorithms.
Usage
SNRMetric(st, algorithm, windowSecs)
Arguments
st |
a |
algorithm |
a named algorithm to use for calculating SNR (default= |
windowSecs |
width (seconds) of the full window used in SNR calculations (default= |
Details
Seismic signals in the Stream must be without gaps, i.e. contained within a single Trace.
algorithm="splitWindow"
This algorithm uses the midpoint of the seismic signal as the border between noise to the left of the midpoint and signal to the right. The value for signal-to-noise is just the rmsVariance calculated for windowSecs/2 seconds of data to the right of the midpoint divided by the rmsVariance for windowSecs/2 seconds of data to the left of the midpoint.
No other algorithms have been vetted at this point.
Value
A list with a single SingleValueMetric
object is returned.
Author(s)
Jonathan Callahan jonathan@mazamascience.com
Examples
## Not run:
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")
# Get an hour long waveform centered on a big quake
starttime <- as.POSIXct("2010-02-27 06:16:15",tz="GMT")
endtime <- as.POSIXct("2010-02-27 07:16:15",tz="GMT")
st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)
tr <- st@traces[[1]]
# Calculate the SNR metric and show the results
metricList <- SNRMetric(st)
dummy <- lapply(metricList, show)
## End(Not run)