Learn R Programming

IRISMustangMetrics (version 2.4.7)

sampleRateChannelMetric: Sample rate consistency between miniSEED and metadata

Description

The sampleRateChannelMetric() function compares the miniSEED sample rate with the sample rate stored in the metadata channel.

Usage

sampleRateChannelMetric(st,
                 channel_pct=1,
                 chan_rate=NULL)

Value

A list of lists is returned containing:

  • m1 = list of sample_rate_channel metric objects

Arguments

st

a Stream object containing a seismic signal

channel_pct

percentage by which the miniSEED and channel sample rates must agree to be considered a match

chan_rate

metadata channel sample rate from miniSEED blockette 52, stationXML, or other metadata representation <Channel:SampleRate> element, optional

Author

Mary Templeton mary.templeton@earthscope.org

Details

This function retrieves the sample rate of the first trace from a Stream object and compares it to the metadata channel sample rate passed as chan_rate to see whether both sample rates agree within channel_pct percent. If chan_rate is not provided, the code will retrieve a sample rate from EarthScope web services.

The sampleRateChannelMetric function calculates and returns the following metrics:

sample_rate_chan -- "agreement between daily miniSEED and metadata channel sample rates"

A boolean measurement that returns 0 if miniSEED and Channel sample rates agree within 1%, or 1 if they disagree.

See Also

SingleValueMetric

Examples

Run this code
  if (FALSE) {
# Open a connection to EarthScope webservices
iris <- new("IrisClient")

starttime <- as.POSIXct("2019-08-01",tz="GMT")
endtime <- as.POSIXct("2019-08-02",tz="GMT")

# Get channel-level metadata, sample rate and normalizaton frequency
meta <- IRISSeismic::getChannel(iris, "IU","ANMO","00","BHZ",starttime,endtime)
chan_rate <- meta$samplerate
  
# Get the waveform
st <- IRISSeismic::getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)

# Calculate the sample rate metrics
list1 <- sampleRateChannelMetric(st,channel_pct=1,chan_rate)
  }

Run the code above in your browser using DataLab