sampleRateRespMetric: Sample rate consistency between miniSEED and metadata

View source: R/sampleRateRespMetric.R

sampleRateRespMetricR Documentation

Sample rate consistency between miniSEED and metadata


The sampleRateRespMetric() function compares the miniSEED sample rate with the sample rate derived from the high-frequency corner of the channel's amplitude response.





a Stream object containing a seismic signal


percentage by which the miniSEED and response-derived sample rates must agree to be considered a match


the normalization frequency at which the stationXML InstrumentSensitivity or dataless Stage 0 Sensitivity is valid, optional


dataframe of freq, amp, phase information matching output of getEvalresp, optional


Next the function retrieves the instrument response that corresponds with the start of the miniSEED time series, from frequencies one decade below the norm_freq through one decade above the miniSEED sampling frequency. The difference of the amplitude values,normalized for frequency spacing, are then scanned to find the first steep rolloff. The frequency associated with the maximum difference in the rolloff is stored as the empirical Nyquist frequency and multiplied by two to give the empirical response-derived sample rate. The function then compares this sample rate with the miniSEED sample rate to see whether both rates agree within resp_pct percent. The default percentage of 15 there is significant variations across instruments. If norm_freq or evalresp values are not provided, the code will retrieve values from IRIS web services.

The sampleRateMetric function calculates and returns the following metrics:

sample_rate_resp – "agreement between daily miniSEED and response-derived sample rates"

A boolean measurement that returns 0 if miniSEED and Response-derived sample rates agree within 15%, or 1 if they disagree. Response-derived sample rates assume that the high-frequency amplitude rolloff is ~85% of the Nyquist frequency.


A list of lists is returned containing:

  • m1 = list of sample_rate_resp metric objects


Mary Templeton

See Also



  ## 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)
norm_freq <- meta$scalefreq
# Get the waveform
st <- IRISSeismic::getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)

# Calculate the sample rate metrics
list1 <- sampleRateRespMetric(st,resp_pct=15,norm_freq)
## End(Not run)

IRISMustangMetrics documentation built on April 28, 2022, 1:06 a.m.