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)
# Convert into corrected "noiseMatrix"
noiseMatrix <- psdList2NoiseMatrix(psdList)
# Convert into McNamara "pdfMatrix"
pdfMatrix <- noiseMatrix2PdfMatrix(noiseMatrix)
# NOTE: Data need to be flipped and tranposed for the XY axes in the
# NOTE: image() function to match rows and columns in our pdfMatrix
# Plot pdfMatrix
image(t(pdfMatrix[,ncol(pdfMatrix):1]),
col=c('gray90',rainbow(9)),
axes=FALSE)
}
Run the code above in your browser using DataLab