The triggerOnset method of Trace objects uses the numeric vector returned by
the STALTA "first break picking" method and a user selected threshold to determine the
arrival time of a seismic event.
Usage
triggerOnset(x, picker, threshold, index)
Arguments
x
a Trace object
picker
results from applying the STALTA method to this trace
threshold
optional numeric value of the threshold at which triggering should occur
index
optional logical to return the index (rather than the time) of event onset (default=FALSE)
Details
This method simply identifies the point at which the picker first rises above the threshold.
When no threshold is supplied, an appropriate value is calculated from the picker with:
threshold <- quantile(picker,0.999,na.rm=TRUE).
Value
A single value is returned identifying the onset of the seismic event or NA if none is detected.
The returned value wil be a POSIXct time by defult or a numeric index if index=TRUE.
Note
The appropriate value for the threshold will depend upon the exact STA/LTA algorithm used and the noise level in the
signal.
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")
starttime <- as.POSIXct("2010-02-27 06:00:00",tz="GMT")
endtime <- as.POSIXct("2010-02-27 09:00:00",tz="GMT")
# Get the waveform
st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)
tr <- st@traces[[1]]
picker <- STALTA(tr,3,30)
# Identify the onset of the event
to <- triggerOnset(tr,picker)
plot(tr)
abline(v=to, col='red', lwd=2)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IRISSeismic)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IRISSeismic/triggerOnset.Rd_%03d_medium.png", width=480, height=480)
> ### Name: triggerOnset
> ### Title: Event onset triggering
> ### Aliases: triggerOnset triggerOnset,Trace,numeric-method
> ### Keywords: methods
>
> ### ** Examples
>
> # Open a connection to IRIS DMC webservices
> iris <- new("IrisClient")
>
> starttime <- as.POSIXct("2010-02-27 06:00:00",tz="GMT")
> endtime <- as.POSIXct("2010-02-27 09:00:00",tz="GMT")
>
> # Get the waveform
> st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)
> tr <- st@traces[[1]]
> picker <- STALTA(tr,3,30)
>
> # Identify the onset of the event
> to <- triggerOnset(tr,picker)
>
> plot(tr)
> abline(v=to, col='red', lwd=2)
>
>
>
>
>
> dev.off()
null device
1
>