DDT | R Documentation |
The DDT
method of Trace
objects returns a new Trace
where data in the @data
slot have been modified. This is typically required before
peforming any kind of spectral analysis on the seismic trace.
DDT(x, demean, detrend, taper)
x |
a |
demean |
logical specifying whether to deman (default= |
detrend |
logical specifying whether to detrend (default= |
taper |
proportion of the signal to be tapered at each end (default=0.1) |
Use taper=0
for no tapering.
A new Trace
object is returned.
Jonathan Callahan jonathan@mazamascience.com
# Open a connection to EarthScope webservices
iris <- new("IrisClient")
# P-wave onset for a big quake
starttime <- as.POSIXct("2010-02-27 06:30:00", tz="GMT")
endtime <- as.POSIXct("2010-02-27 07:00:00", tz="GMT")
result <- try(st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime))
if (inherits(result,"try-error")) {
message(geterrmessage())
} else {
tr <- st@traces[[1]]
trClean <- DDT(tr,TRUE,TRUE,0.1)
layout(matrix(seq(2)))
plot(tr)
abline(h=0,col='gray60')
mtext("Raw",side=3,line=-2,adj=0.05,col='red')
plot(trClean)
abline(h=0,col='gray60')
mtext("Demean - Detrend - Cosine Taper",line=-2,side=3,adj=0.05,col='red')
}
# Restore default layout
layout(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.