transferFunctionMetric {IRISMustangMetrics} | R Documentation |
Cross-spectral comparison
Description
The transferFunctionMetric() 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 evalresp web service.
Usage
transferFunctionMetric(st1, st2, evalresp1, evalresp2)
Arguments
st1 |
a |
st2 |
a |
evalresp1 |
a |
evalresp2 |
a |
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)
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 betweenst1
andst2
phase_diff
– reasonableness of cross-spectral phase betweenst1
andst2
ms_coherence
– mean square coherence betweenst1
andst2
These values can be interpreted as follows:
Whenever ms_coherence ~= 1.0
, properly functioning seismometers should have:
gain_raio ~= 1.0
phase_diff < 10.0
(degrees)
Note
Seismic streams passed to transferFunctionMetric() must have the same network, station and channel and must cover the same time range. The two channels should also have values of azimuth and dip within five degrees of each other. If sampling rates differ and one is a multiple of the other, the stream with the higher sampling rate will be decimated to match the lower sampling rate.
The metricList generated for these two-channel metrics will have a SNCL code of the form:
N.S.L1:L2.C.Q
.
Author(s)
Jonathan Callahan jonathan@mazamascience.com (R code), Mary Templeton mary.templeton@earthscope.org (algorithm)
Examples
## Not run:
# Create a new IrisClient
iris <- new("IrisClient", debug=TRUE)
# Get seismic data
starttime <- as.POSIXct("2011-05-01 12:00:00", tz="GMT")
endtime <- starttime + 3600
st1 <- getDataselect(iris,"CI","PASC","00","BHZ",starttime,endtime,inclusiveEnd=FALSE)
st2 <- getDataselect(iris,"CI","PASC","10","BHZ",starttime,endtime,inclusiveEnd=FALSE)
evalresp1 <- IRISSeismic::transferFunctionSpectra(st1,40)
evalresp2 <- IRISSeismic::transferFunctionSpectra(st2,40)
# Calculate metrics
metricList <- transferFunctionMetric(st1,st2,evalresp1,evalresp2)
print(metricList)
## End(Not run)