ctdDecimate | R Documentation |
Interpolate a CTD profile to specified pressure values. This is used
by sectionGrid()
, but is also useful for dealing with individual
CTD/bottle profiles.
ctdDecimate(
x,
p = 1,
method = "boxcar",
rule = 1,
e = 1.5,
na.rm = FALSE,
debug = getOption("oceDebug")
)
x |
a ctd object. |
p |
pressure increment, or vector of pressures. In the first case,
pressures from 0dbar to the rounded maximum pressure are used, incrementing by
|
method |
the method to be used for calculating decimated values. This may be a string specifying the method, or a function. In the string case, the possibilities are as follows.
On the other hand, if |
rule |
an integer that is passed to |
e |
is an expansion coefficient used to calculate the local neighbourhoods
for the |
na.rm |
logical value indicating whether to remove NA values
before decimating. This value is ignored unless |
debug |
an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many |
The "approx"
and "approxML"
methods may be best for bottle data,
in which the usual task is
to interpolate from a coarse sampling grid to a finer one. The distinction
is that "approxML"
assumes a mixed-layer above the top sample value. For CTD data, the
"boxcar"
method may be the preferred choice, because the task is normally
to sub-sample, and some degree of smoothing is usually desired. (The
"lm"
method can be quite slow, and its results may be quite similar to those of the
boxcar method.)
For widely-spaced data, a sort of numerical cabeling effect can result when density is computed based on interpolated salinity and temperature. See reference 2 for a discussion of this issue and possible solutions.
A ctd object, with pressures that are as set by
the "p"
parameter and all other properties modified appropriately.
Data-quality flags contained within the original object are ignored by this
function, and the returned value contains no such flags. This is because such
flags represent an assessment of the original data, not of quantities derived
from those data. This function produces a warning to this effect. The
recommended practice is to use handleFlags()
or some other means to
deal with flags before calling the present function.
Dan Kelley
R.F. Reiniger and C.K. Ross, 1968. A method of interpolation with application to oceanographic data. Deep Sea Research, 15, 185-193.
Oguma, Sachiko, Toru Suzuki, Yutaka Nagata, Hidetoshi Watanabe, Hatsuyo Yamaguchi, and Kimio Hanawa. “Interpolation Scheme for Standard Depth Data Applicable for Areas with a Complex Hydrographical Structure.” Journal of Atmospheric and Oceanic Technology 21, no. 4 (April 1, 2004): 704-15.
The documentation for ctd explains the structure of CTD objects, and also outlines the other functions dealing with them.
Other things related to ctd data:
CTD_BCD2014666_008_1_DN.ODF.gz
,
[[,ctd-method
,
[[<-,ctd-method
,
as.ctd()
,
cnvName2oceName()
,
ctd
,
ctd-class
,
ctd.cnv.gz
,
ctdFindProfiles()
,
ctdFindProfilesRBR()
,
ctdRaw
,
ctdRepair()
,
ctdTrim()
,
ctd_aml.csv.gz
,
d200321-001.ctd.gz
,
d201211_0011.cnv.gz
,
handleFlags,ctd-method
,
initialize,ctd-method
,
initializeFlagScheme,ctd-method
,
oceNames2whpNames()
,
oceUnits2whpUnits()
,
plot,ctd-method
,
plotProfile()
,
plotScan()
,
plotTS()
,
read.ctd()
,
read.ctd.aml()
,
read.ctd.itp()
,
read.ctd.odf()
,
read.ctd.odv()
,
read.ctd.saiv()
,
read.ctd.sbe()
,
read.ctd.ssda()
,
read.ctd.woce()
,
read.ctd.woce.other()
,
setFlags,ctd-method
,
subset,ctd-method
,
summary,ctd-method
,
woceNames2oceNames()
,
woceUnit2oceUnit()
,
write.ctd()
library(oce)
data(ctd)
plotProfile(ctd, "salinity", ylim = c(10, 0))
p <- seq(0, 45, 1)
ctd2 <- ctdDecimate(ctd, p = p)
lines(ctd2[["salinity"]], ctd2[["pressure"]], col = "blue")
p <- seq(0, 45, 1)
ctd3 <- ctdDecimate(ctd, p = p, method = function(x, y, xout) {
predict(smooth.spline(x, y, df = 30), xout)$y
})
lines(ctd3[["salinity"]], ctd3[["pressure"]], col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.