## Not run:
# # Open a connection to IRIS DMC webservices
# iris <- new("IrisClient")
#
# # Trying to match the results in figure 2a of
# #
# # "Determination of New Zealand Ocean Bottom Seismometer Orientation
# # via Rayleigh-Wave Polarization", Stachnik et al.
# #
# # geode.colorado.edu/~sheehan/pdf/StachnikNZorientation-SRL2012.pdf
#
# starttime <- as.POSIXct("2009-02-18 22:01:07",tz="GMT")
# endtime <- starttime + 630
# verticalLines <- starttime + seq(30,630,100)
#
# # Get data
# stZ <- getSNCL(iris,"ZU.NZ19..BHZ",starttime,endtime)
# st2 <- getSNCL(iris,"ZU.NZ19..BH2",starttime,endtime)
# st1 <- getSNCL(iris,"ZU.NZ19..BH1",starttime,endtime)
#
# # Demean, Detrend, Taper
# trZ <- DDT(stZ@traces[[1]],TRUE,TRUE,0.05)
# tr2 <- DDT(st2@traces[[1]],TRUE,TRUE,0.05)
# tr1 <- DDT(st1@traces[[1]],TRUE,TRUE,0.05)
#
# # Bandpass filter
# trZ_f <- butterworth(trZ,2,0.02,0.04,type='pass')
# tr2_f <- butterworth(tr2,2,0.02,0.04,type='pass')
# tr1_f <- butterworth(tr1,2,0.02,0.04,type='pass')
#
# # 3 rows
# layout(matrix(seq(3)))
#
# # Plot
# plot(trZ_f)
# abline(v=verticalLines,col='gray50',lty=2)
# plot(tr2_f)
# abline(v=verticalLines,col='gray50',lty=2)
# plot(tr1_f)
# abline(v=verticalLines,col='gray50',lty=2)
#
# # Restore default layout
# layout(1)
# ## End(Not run)
Run the code above in your browser using DataLab