Learn R Programming

oce (version 0.1.67)

ctd.decimate: Decimate a CTD profile

Description

Smooth and decimate a CTD profile.

Usage

ctd.decimate(x, p=NULL, method=c("boxcar","lm"), e=1)

Arguments

x
a ctd object, e.g. as read by read.ctd.
p
controls the selection of pressure levels, as follows. If NULL (the default), then the list of pressures for the decimation is to be selected automatically, using pretty. If a single value is s
method
Method for calculating decimated values. Use "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
is an expansion coefficient used to calculate the smoothing neighbourhoods. If 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 a

Value

  • A new ctd object.

Details

This function is useful for calculations that require data to be defined at a fixed set of pressure values. Normally, the target pressures are supplied by the user (e.g. to simplify thermal-wind calculations based on pairs of CTD profiles), but the routine can select the target pressures automatically. The smoothing part of the algorithm is based on neighbourhoods of each target pressures.

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)

See Also

A ctd object may be read with read.ctd, and ctd.trim is useful in trimming spurious data (e.g. those obtained during the upcast).

Examples

Run this code
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