The SNRMetric() function calculates the Signal-to-Noise Ratio of a seismic trace by one of several named algorithms.
SNRMetric(st, algorithm, windowSecs)
a named algorithm to use for calculating SNR (default=
width (seconds) of the full window used in SNR calculations (default=
Seismic signals in the Stream must be without gaps, i.e. contained within a single Trace.
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.
A list with a single
SingleValueMetric object is returned.
Jonathan Callahan email@example.com
## 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[] # Calculate the SNR metric and show the results metricList <- SNRMetric(st) dummy <- lapply(metricList, show) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.