if (FALSE) {
# Open a connection to IRIS DMC webservices
iris <- new("IrisClient")
# Three Streams, each with different upDownTimes
starttime <- as.POSIXct("2012-07-01", tz="GMT")
endtime <- as.POSIXct("2012-07-02", tz="GMT")
stE <- getDataselect(iris,"IU","XMAS","10","BHE",starttime,endtime)
stN <- getDataselect(iris,"IU","XMAS","10","BHN",starttime,endtime)
stZ <- getDataselect(iris,"IU","XMAS","10","BHZ",starttime,endtime)
udtE <- getUpDownTimes(stE)
udtN <- getUpDownTimes(stN)
udtZ <- getUpDownTimes(stZ)
udtAll <- c()
udtAny <- c()
for (udt in list(udtE, udtN, udtZ)) {
udtAll <- mergeUpDownTimes(udtAll,udt,bothOn=TRUE)
udtAny <- mergeUpDownTimes(udtAny,udt,bothOn=FALSE)
}
# 5 rows
layout(matrix(seq(5)))
# Plot the results
par(mar=c(3,4,3,2)) # adjust margins
plotUpDownTimes(udtE); title("BHE")
plotUpDownTimes(udtN); title("BHN")
plotUpDownTimes(udtZ); title("BHZ")
plotUpDownTimes(udtAll); title("ALL channels up")
plotUpDownTimes(udtAny); title("ANY channel up")
# Restore default layout
layout(1)
}
Run the code above in your browser using DataLab