Learn R Programming

IRISSeismic (version 1.6.6)

transferFunctionSpectra: function to retrieve response values to use for input to the IRISMustangMetrics::transferFunctionMetric

Description

The transferFunctionSpectra function returns a frequency-amplitude-phase response from the service.iris.edu/iris/ws/evalresp web service for a seismic Stream object using sampling_rate to determine frequency limits. The IRISMustangMetrics::transferFunctionMetric expects this output as evalresp input.

Usage

transferFunctionSpectra(st,sampling_rate)

Value

Output is a dataframe with columns named:

freq, amp, phase

Arguments

st

a Stream object

sampling_rate

sample rate

Author

Mary Templeton met@iris.washington.edu

Details

The transferFunctionSpectra /determines the minfreq, maxfreq, and nfreq for input to the getEvalresp function based on input sample rate. Other getEvalresp inputs are units='def' (default) and output='fap' (frequency-amplitude-phase).

transferFunctionSpectra will always call getEvalresp using the service.iris.edu/irisws/evalresp web service. The IRISMustangMetrics::transferFunctionMetric expects this output as evalresp input.

See Also

getEvalresp,

Examples

Run this code
if (FALSE) {
# Create a new IrisClient
iris <- new("IrisClient", debug=TRUE)

# Get seismic data
starttime <- as.POSIXct("2011-05-05", tz="GMT") 
endtime <- starttime + 1*24*3600
st <- getDataselect(iris,"IU","GRFO","--","BHE",starttime,endtime)
sampling_rate <- 20

# Generate power spectral density for each hour long segment
evalresp  <- transferFunctionSpectra(st,sampling_rate)

}

Run the code above in your browser using DataLab