ctd.trim {oce}R Documentation

Trim start/end portions of a CTD cast

Description

Trim start/end portions of a CTD cast.

Usage

ctd.trim(x, method="downcast",parameters=NULL)

Arguments

x A ctd object, e.g. as read by read.ctd.
method Various methods exist, some of which use parameters:
"downcast"
Select only data for which the CTD is descending, as inferred from the pressure change over time
"upcast"
Reverse of "downcast" ... not too useful
"index"
Select values only in indicated list of indices, e.g. selection <- trim.ctd(ctd, "index", seq(10,30)) selects data points 10, 11, ... 30.
"(ANYTHING ELSE)"
Select data only if the named item (e.g. 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 <- trim.ctd(ctd, "scan", 5) starts at scan number 5 and continues to the end, while ctd3 <- trim.ctd(ctd, "scan", c(5,100)) also starts at scan 5, but extends only to scan 100.
parameters Depends on method; see above.

Details

The code is quite straightforward, and indeed it's a good idea to check the code, if you want something more sophisticated, e.g. selecting data based on a T-S criterion. The most common use of this is to run plot.ctd.scan() together with ctd.trim, identifying by eye an initial period in which the CTD is in the air or unequilibrated in the water, and a final period in which the CTD is no longer descending.

Value

A new ctd object.

Author(s)

Dan Kelley Dan.Kelley@Dal.Ca

References

The Seabird CTD instrument is described at http://www.seabird.com/products/spec_sheets/19plusdata.htm.

See Also

The ctd object may be read with read.ctd. plot.ctd.scan is very useful in providing guidance in how to trim; it is common practice to plot a scan first, then to trim by scan.

Examples

library(oce)
data(ctd) 
ctd.trimmed <- ctd.trim(ctd, "pressure", c(3, 5))
summary(ctd.trimmed)

[Package oce version 0.1.59 Index]