getUpDownTimes | R Documentation |
The getUpDownTimes
method determines the on/off times for data collection within a Stream
and returns a list containing these times, ignoring Trace
s with a duration less than min_signal
as well as data dropouts that are less than min_gap
.
getUpDownTimes(x, min_signal, min_gap)
x |
|
min_signal |
minimum |
min_gap |
minimum gap in seconds (default=60) |
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 the Trace@data
slot. Each Trace
also contains a starttime
and an endtime
representing
a period of uninterrupted data collection. Data dropouts are determined by first rejecting any Trace
s of duration less than min_signal
.
The temporal spacing between Trace
s is then analyzed, ignoring spaces shorter than min_gap
.
This method first checks the SNCL id of each Trace
to make sure they are identical
and throws an error if they are not.
The first element returned is always the starttime
associated the first Trace
. The last element is always the
endtime
associated with the last trace. Thus, when the first element is identical to the starttime
of the web services data request this does not necessarily mean that the channel was down before this.
NOTE: Even when data are complete for the duration of the requested timespan, the last element returned may be earlier than the endtime
of the web services data request by up to a second.
A vector of POSIXct
datetimes associated with on/off transitions.
Jonathan Callahan jonathan@mazamascience.com
plotUpDownTimes
## 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) # Determine up/down transitions, ignoring Traces < 3 min and gaps < 5 min upDownTimes <- getUpDownTimes(st, min_signal=180, min_gap=300) # Or just plot them directly plotUpDownTimes(st, min_signal=180, min_gap=300) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.