getGaps {IRISSeismic} | R Documentation |
Gap analysis
Description
The getGaps
method calculates data dropouts that occur within the requested time
range associated with a Stream
.
A Stream
object returned by getDataselect
contains a list of individual
Trace
objects, each of which is guaranteed to contain a continuous array of
data in each Trace@data
slot. Each TraceHeader
also contains a starttime
and
an endtime
defining a period of uninterrupted data collection.
Data dropouts are determined by examining the requestedStartime
and requestedEndtime
slots associated with the Stream
and the starttime
and endtime
slots
found in the each TraceHeader
.
Usage
getGaps(x, min_gap)
Arguments
x |
|
min_gap |
minimum gap (sec) below which gaps will be ignored (default=1/sampling_rate) |
Details
This method first checks the SNCL id of each Trace
to make sure they are identical
and generates an error if they are not. Mismatches in the sampling_rate
will also generate
an error.
The data gaps (in seconds) within a Stream
are
determined and the associated sampling_rate
is used to calculate the number of
missing values in each gap. The length of the gaps
and nsamples
vectors
in the returned list will be one more than the number of Traces
(inital gap + gaps between traces + final gap).
Gaps smaller than min_gap
are set to 0
. Values of min_gap
smaller
than 1/sampling_rate
will be ignored and the default value will be used instead.
Overlaps will appear as gaps with negative values.
Value
A list is returned with the following elements:
gaps
numeric vector of data gaps within aStream
nsamples
number of missing samples associated with each gap
Author(s)
Jonathan Callahan jonathan@mazamascience.com
Examples
## Not run:
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")
starttime <- as.POSIXct("2012-01-24", tz="GMT")
endtime <- as.POSIXct("2012-01-25", tz="GMT")
# Get the waveform
st <- getDataselect(iris,"AK","PIN","","BHZ",starttime,endtime)
# Save the gap analysis in a variable
gapInfo <- getGaps(st)
# See what information is availble
names(gapInfo)
# Look at a histogram of data dropouts
hist(gapInfo$nsamples, breaks=50,
main="Data Gaps in AK.PIN..BHZ Jan 24, 2012",
xlab="number of missing samples per gap")
## End(Not run)