ctd.trim {oce} | R Documentation |
Trim start/end portions of a CTD cast.
ctd.trim(x, method="downcast",parameters=NULL, verbose=FALSE)
x |
A ctd object, e.g. as read by read.ctd . |
method |
Various methods exist, some of which use parameters:
selection <- ctd.trim(ctd, "index", seq(10,30))
selects data points 10, 11, ... 30.scan , time , etc.) falls
in the range of values indicated by parameters . If one
parameter is given, it is a lower limit. If two parameters
are given, they are a range.
For example, ctd2 <- ctd.trim(ctd, "scan", 5)
starts at scan number 5 and continues to the end,
while ctd3 <- ctd.trim(ctd, "scan", c(5,100))
also starts at scan 5, but extends only to scan 100. |
parameters |
Depends on method; see above. |
verbose |
If set to TRUE, some debugging information is provided. |
For normal CTD profiling, the goal is to isolate only the downcast,
discarding measurements made in the air, in an equilibration phase in
which the device is held below the water surface, and then the upcast
phase that follows the downcast. This is handled reasonably well by
ctd.trim
with method="downcast"
. (The datasets provided
with oce
were produced this way.)
However, for detailed work it makes sense to do things semi-manually.
The eye is simply better at handling exceptional cases. The process
is simple: use plot.ctd.scan()
to get an idea of the scan
indices of the downacast, and then use ctd.trim
with
method="index"
. A few trials will normally identify the
downcast very well.
An object of class
"ctd"
, with data having been trimmed in some way.
Dan Kelley
The Seabird CTD instrument is described at http://www.seabird.com/products/spec_sheets/19plusdata.htm.
The ctd
object may be read with read.ctd
.
plot.ctd.scan
is very useful in providing guidance
for trimming with ctd.trim
.
library(oce) data(ctd.raw) plot(ctd.raw) # barely recognizable, due to pre- and post-cast junk plot(ctd.trim(ctd.raw)) # looks like a real profile ... plot(ctd.decimate(ctd.trim(ctd.raw),method="boxcar")) # ... smoothed