eventWindow | R Documentation |
The eventWindow
method of Trace
uses the picker returned by the STALTA()
method
to center a window around the the event detected by the picker.
eventWindow(x, picker, threshold, windowSecs)
x |
a |
picker |
a picker as returned by the |
threshold |
the threshold at which the picker is 'triggered' |
windowSecs |
the size of the window in secs |
This utility function uses the trace method triggerOnset()
to determine
p-wave onset followed by the slice()
method to return a new Trace
object of
the desired size centered near the event onset.
When no threshold value is supplied, the default value is calculated as:
threshold=quantile(picker,0.999,na.rm=TRUE)
A new Trace
object is returned.
Jonathan Callahan jonathan@mazamascience.com
STALTA
,
triggerOnset
## Not run: # Open a connection to IRIS DMC webservices iris <- new("IrisClient") starttime <- as.POSIXct("2002-04-20", tz="GMT") endtime <- as.POSIXct("2002-04-21", tz="GMT") # Get the waveform st <- getDataselect(iris,"US","OXF","","BHZ",starttime,endtime) # Seismic signal in third trace tr <- st@traces[[3]] # Create a picker picker <- STALTA(tr,3,30) threshold <- quantile(picker,0.99999,na.rm=TRUE) # 3 rows layout(matrix(seq(3))) # Plot trace and p-wave closeups closeup1 <- eventWindow(tr,picker,threshold,3600) closeup2 <- eventWindow(tr,picker,threshold,600) plot(tr) plot(closeup1,subsampling=1) abline(v=length(closeup1)/2, col='red') plot(closeup2,subsampling=1) abline(v=length(closeup2)/2, col='red') # Restore default layout layout(1) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.