ctd.decimate(x, p=NULL, method=c("boxcar","lm"), e=1)ctd object, e.g. as read by read.ctd.NULL (the default), then the list of pressures for the decimation is to be selected automatically, using pretty. If a single
value is s"boxcar" (the default)
for boxcar averaging within the pressure region.
Use "lm" to use the prediction of a linear
model applied to each pressure region. (See e
for an e=1, then the neighbourhood for the i-th pressure extends from the (i-1)-th pressure
to the (i+1)-th pressure. (At the endpoints it is actd object.Note that the density that results from the decimation is calculated from an average, and so it may not match with the averaged salinity and temperature. This is a sort of numerical cabeling effect, and if you would like to avoid this, just do as follows
xd <- ctd.decimate(x) xd$data$sigma <- sw.sigma(xd$data$salinity, xd$data$temperature, xd$data$pressure)
ctd object may be read with read.ctd,
and ctd.trim is useful in trimming spurious data
(e.g. those obtained during the upcast).library(oce)
data(ctd.raw)
ctd.clean <- ctd.decimate(ctd.trim(ctd.raw))
summary(ctd.clean)Run the code above in your browser using DataLab