ctdTrim {oce}R Documentation

Trim Beginning and Ending of a CTD cast

Description

Often in 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 ctdTrim with method="downcast", although it is almost always best to use plotScan to investigate the data, and then use the method="index" or method="scan" method based on visual inspection of the data.

Usage

ctdTrim(x, method, removeDepthInversions = FALSE, parameters = NULL,
  debug = getOption("oceDebug"))

Arguments

x

A ctd object, i.e. one inheriting from ctd-class.

method

A string (or a vector of two strings) specifying the trimming method, or a function to be used to determine data indices to keep. If method is not provided, "downcast" is assumed. See “Details”.

removeDepthInversions

Logical value indicating whether to remove any levels at which depth is less than, or equal to, a depth above. (This is needed if the object is to be assembled into a section, unless ctdDecimate will be used, which will remove the inversions.

parameters

A list whose elements depend on the method; see “Details”.

debug

an integer specifying whether debugging information is to be printed during the processing. This is a general parameter that is used by many oce functions. Generally, setting debug=0 turns off the printing, while higher values suggest that more information be printed. If one function calls another, it usually reduces the value of debug first, so that a user can often obtain deeper debugging by specifying higher debug values.

Details

ctdTrim begins by examining the pressure differences between subsequent samples. If these are all of the same value, then the input ctd object is returned, unaltered. This handles the case of pressure-binned data. However, if the pressure difference varies, a variety of approaches are taken to trimming the dataset.

Value

An object of ctd-class, with data having been trimmed in some way.

Author(s)

Dan Kelley and Clark Richards

References

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

Seasoft V2: SBE Data Processing, SeaBird Scientific, 05/26/2016

See Also

Other things related to ctd data: [[,ctd-method, [[<-,ctd-method, as.ctd, cnvName2oceName, ctd-class, ctdDecimate, ctdFindProfiles, ctdRaw, ctd, handleFlags,ctd-method, oceNames2whpNames, oceUnits2whpUnits, plot,ctd-method, plotProfile, plotScan, plotTS, read.ctd.itp, read.ctd.odf, read.ctd.sbe, read.ctd.woce.other, read.ctd.woce, read.ctd, subset,ctd-method, summary,ctd-method, woceNames2oceNames, woceUnit2oceUnit, write.ctd

Examples

## Not run: 
library(oce)
data(ctdRaw)
plot(ctdRaw) # barely recognizable, due to pre- and post-cast junk
plot(ctdTrim(ctdRaw)) # looks like a real profile ...
plot(ctdDecimate(ctdTrim(ctdRaw),method="boxcar")) # ... smoothed
# Demonstrate use of a function. The scan limits were chosen
# by using locator(2) on a graph made by plotScan(ctdRaw).
trimByIndex<-function(data, parameters) {
  parameters[1] < data$scan & data$scan < parameters[2]
}
trimmed <- ctdTrim(ctdRaw, trimByIndex, parameters=c(130, 380))
plot(trimmed)

## End(Not run)


[Package oce version 0.9-22 Index]