Learn R Programming

IRISSeismic (version 1.0.5)

psdList2NoiseMatrix: Apply instrument correction to PSDs

Description

The psdList2NoiseMatrix function uses the snclq identifier associated with the first PSD in the list to obtain instrument correction information at the specified frequencies from the getEvalresp web service. This correction is applied to every PSD in the list and the now corrected PSD values are returned as a matrix.

Usage

psdList2NoiseMatrix(psdList)

Arguments

psdList
a list of PSDs generated by the psdList function

Value

  • A matrix is returned with one row for each instrument-corrected PSD and one column for each frequency bin.

References

http://pubs.usgs.gov/of/2005/1438/pdf/OFR-1438.pdf{Seismic Noise Analysis System Using Power Spectral Density Probability Density Functions} (McNamara and Boaz 2005)

See Also

McNamaraPSD, psdDF2NoiseMatrix, psdList, psdPlot, psdStatistics,

Examples

Run this code
# 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)

# Plot corrected PSDs
period <- 1/psdList[[1]]$freq
plot(period, noiseMatrix[1,], log='x', type='l',
     ylim=c(-200,-50),
     xlab="Period (Sec)", ylab="Power (dB)",
     main="Corrected PSDs")
     
for (i in seq(2:nrow(noiseMatrix))) {
  points(period, noiseMatrix[i,], type='l')
}

Run the code above in your browser using DataLab