sampleRateChannelMetric: Sample rate consistency between miniSEED and metadata

View source: R/sampleRateChannelMetric.R

sampleRateChannelMetricR Documentation

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)

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

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 IRIS 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.

Value

A list of lists is returned containing:

  • m1 = list of sample_rate_channel metric objects

Author(s)

Mary Templeton mary.templeton@earthscope.org

See Also

SingleValueMetric

Examples

  ## Not run: 
# Open a connection to IRIS DMC 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)
  
## End(Not run)

IRISMustangMetrics documentation built on Aug. 22, 2023, 9:11 a.m.