Learn R Programming

IRISMustangMetrics (version 1.0.0)

transferFunctionMetrics: Cross-spectral comparison

Description

The transferFunctionMetrics() function calculates metrics that assess the relationship between two SNCLs with the same network, station and channel but separate locations. When seismometers are working properly, the transfer function amplitude and phase will match similar values calculated from the instrument responses.

This function calculates the transfer function from data in the incoming streams. Response information is then obtained from the http://service.iris.edu/irisws/evalresp/1/{evalresp web service}.

Usage

transferFunctionMetrics(st1, st2)

Arguments

st1
a Stream object containing a seismic signal
st2
a Stream object containing a seismic signal

Value

  • A list with a single SingleValueMetric object is returned. The metric name is transfer_function and it has three attributes:
    • gain_ratio-- reasonableness of cross-spectral amplitude betweenst1andst2
  • phase_diff -- reasonableness of cross-spectral phase between st1 and st2
  • ms_coherence -- mean square coherence between st1 and st2

code

ms_coherence ~= 1.0

itemize

  • gain_raio ~= 1.0

item

phase_diff < 10.0 (degrees)

Details

Details of the algorithm are as follows # compute complex cross-spectrum of traces x and y ==> Pxx, Pxy, Pyy # calculate transfer function values: # Txy(f) = Pxy(f) / Pxx(f) # dataGain <- Mod(Txy) # dataPhase <- Arg(Txy) # # calculate avgDataGain and avgDataPhase values for periods of 5-7s # # calculate the corresponding response amplitude ratio and phase difference: # request responses for x and y # respGain = respGainy(f) / respGainx(f) # respPhase = respPhasey(f) - respPhasex(f) # # calculate avgRespGain and avgRespPhase values for periods of 5-7s # # calculate metrics: # gain_ratio = avgDataGain / avgRespGain # hase_diff = avgDataPhase - avgRespPhase # ms_coherence = |Pxy|^2 / (Pxx*Pyy)

Examples

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

# Get seismic data
starttime <- as.POSIXct("2011-05-01", tz="GMT")
endtime <- starttime + 3600

st1 <- getDataselect(iris,"CI","PASC","00","BHZ",starttime,endtime)
st2 <- getDataselect(iris,"CI","PASC","10","BHZ",starttime,endtime)

# Calculate metrics
metricList <- transferFunctionMetrics(st1,st2)
print(metricList)

Run the code above in your browser using DataLab