# NOT RUN {
library(oce)
# }
# NOT RUN {
# Example 1. Find profiles within a towyo file, as can result
# if the CTD is cycled within the water column as the ship
# moves.
profiles <- ctdFindProfiles(towyo)
# }
# NOT RUN {
# }
# NOT RUN {
# Example 2. Use a moving average to smooth pressure, instead of the
# default smooth.spline() method. This might avoid a tendency of
# the default scheme to miss some profiles in a long towyo.
movingAverage <- function(x, n = 11, ...)
{
f <- rep(1/n, n)
stats::filter(x, f, ...)
}
casts <- ctdFindProfiles(towyo, smoother=movingAverage)
# }
# NOT RUN {
# }
# NOT RUN {
# Example 3: glider data read into a ctd object. Chop
# into profiles by looking for pressure jumps exceeding
# 10 dbar.
breaks <- which(diff(gliderAsCtd[["pressure"]]) > 10)
profiles <- ctdFindProfiles(gliderAsCtd, breaks=breaks)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab