Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 if instrumentation correction information is not supplied as an argument. This correction is applied to every PSD in the list and the now corrected PSD values are returned as a matrix.

Usage

psdList2NoiseMatrix(psdList, evalresp=NULL)

Arguments

psdList

a list of PSDs generated by the psdList function

evalresp

dataframe of freq, amp, phase information matching output of getEvalresp, optional

Value

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

Note

The psdList function generates a psdList from a single Stream of data and should thus only contain data for a single SNCL (Station-Network-Channel-Location). However, the psdList is not checked to make sure that no changes to the instrument correction happened during the time period covered by the psdList. This occurs at an 'epoch' boundary when an instrument is replaced.

Author(s)

Jonathan Callahan jonathan@mazamascience.com

References

See Also

Examples

## Not run: 
# 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')
}

## End(Not run)

IRISSeismic

Classes and Methods for Seismic Data Analysis

v1.6.2
GPL (>= 2)
Authors
Jonathan Callahan [aut], Rob Casey [aut], Gillian Sharer [aut, cre], Mary Templeton [aut], Chad Trabant [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.