if (FALSE) {
# Create a new IrisClient
iris <- new("IrisClient", debug=TRUE)
# Get seismic data
starttime <- as.POSIXct("2011-05-05", tz="GMT") # 2011.125
endtime <- starttime + 1*24*3600
st <- getDataselect(iris,"IU","GRFO","--","BHE",starttime,endtime)
# Generate power spectral density for each hour long segment
psdList <- psdList(st)
# Generate Statistics
stats <- psdStatistics(psdList)
# Just for fun plot
logPeriod <- log10(1/stats$freq)
plot(logPeriod,stats$max,ylim=c(-200,-50), las=1,
xlab="log10(period)", ylab="Power (dB)",
main="Model 'normal background noise' area and area of seismic signal.")
points(logPeriod,stats$min)
# Overlay a polygon showing the range between the noise models
x <- c(logPeriod,rev(logPeriod),logPeriod[1])
y <- c(stats$nhnm,rev(stats$nlnm),stats$nhnm[1])
transparentBlack <- adjustcolor('black',0.4)
polygon(x,y,col=transparentBlack)
# Overlay a polygon showing the range of measured values
y <- c(stats$max,rev(stats$min),stats$max[1])
transparentBlue <- adjustcolor('blue',0.6)
polygon(x,y,col=transparentBlue)
}
Run the code above in your browser using DataLab