read.ctd {oce}R Documentation

Scan seawater (CTD) data file

Description

Read a data file created by a Sea-Bird CTD.

Usage

read.ctd(file, type="SBE19", debug=FALSE, columns=NULL, check.human.headers=TRUE)

Arguments

file A connection or a character string giving the name of the file to load.
type String indicating type of instrument: SBE19 stands for the Seabird 19 CTD.
debug Set true to print debugging information.
columns If NULL, read.ctd tries to infer column names from the header. If a list, then it will be taken to be the list of columns. The list must include "pressure", "temperature" and either "conductivity" or "salinity", or else very little can be done with the file.
check.human.headers Set TRUE to make it give warnings for missing human-written header items.

Details

Oceanographers use a CTD (conductivity-temperature-depth) instrument to measure some key properties of ocean Physics. This function reads CTD datasets created with the popular Sea-Bird instrument. Although read.ctd scans the header information in an attempt to infer the measured variables, it cannot account for the wide variability of headers that are used in practice. For example, in the first file tested during development, the sampling rate was written as * sample rate = 1 scan every 0.5 seconds, while in the second test file it was written * Real-Time Sample Interval = 0.125 seconds. Yes, there are similarities, but what is the general rule? Nobody has been able to tell me ... and all of this suggests that a robust scanner will never be written. The best advice is to read in a CTD object (c, say) using the default scheme and then to do attributes(c) to discover whether the fields of interest were filled in. Then, check whether the columns were discovered correctly; if not, read it again and then set the attributes manually.

Value

A ctd object containing information about the station (e.g. latitude, etc.), along with vectors containing the acquired data (e.g. S, etc.). The full header is also contained in the list. Specifically, the returned list contains:

header[] the header itself, normally containing 66 lines of information
ship name of the ship from which the CTD was deployed
scientist name of the scientist taking the data
institute name of the institute
address the address of the institute where the scientist
cruise name of cruise
mooring mooring number or name
date date of lowering of CTD into the water
latitude latitude, as a character string
latitude.dec latitude, in decimal degrees positive north of equator
longitude longitude, as a character string
longitude.dec longitude, in decimal degrees, positive if east of Greenwich and west of dateline
recovery date of recovery of CTD
sample.interval time interval between samples [s]
water.depth the water depth at the site [m]
data A data table containing the profile data as vectors. The column names are discovered from the header, and may thus differ from file to file. For example, some CTD instruments may have a fluorometer connected, others may not. The following vectors are, however, guaranteed to be present: data$pressure, data$salinity, data$temperature and data$sigma. and data$OK. Note that data$sigma is calculated from the pressure, salinity, and temperature in the file, using sw.sigma. If the file also contains sw.sigma.t or sw.sigma.theta, then these will also appear in the data table.

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

summary.ctd

Examples

## Not run: 
library(oce)
prof <- read.ctd("/usr/local/lib/R/library/oce/demo/ctdprofile.cnv")
attach(prof)
plot(t, pressure) # T profile
## End(Not run)

[Package oce version 0.1.59 Index]