transferFunctionSpectra: function to retrieve response values to use for input to the...

View source: R/spectralUtils.R

transferFunctionSpectraR Documentation

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)

Arguments

st

a Stream object

sampling_rate

sample rate

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.

Value

Output is a dataframe with columns named:

freq, amp, phase

Author(s)

Mary Templeton met@iris.washington.edu

See Also

getEvalresp,

Examples

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


## End(Not run)

IRISSeismic documentation built on Oct. 16, 2022, 1:09 a.m.