Learn R Programming

IRISMustangMetrics (version 2.4.6)

transferFunctionMetric: 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)

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 between st1 and st2

  • phase_diff -- reasonableness of cross-spectral phase between st1 and st2

  • ms_coherence -- mean square coherence between st1 and st2

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)

Arguments

st1

a Stream object containing a seismic signal

st2

a Stream object containing a seismic signal

evalresp1

a data frame containing an amplitude and phase spectrum

evalresp2

a data frame containing an amplitude and phase spectrum

Author

Jonathan Callahan jonathan@mazamascience.com (R code), Mary Templeton mary.templeton@earthscope.org (algorithm)

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
  if (FALSE) {
# 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)
  }

Run the code above in your browser using DataLab