Learn R Programming

oce (version 0.1.63)

read.ctd: 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 "sal
check.human.headers
Set TRUE to make it give warnings for missing human-written header items.

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
  • shipname of the ship from which the CTD was deployed
  • scientistname of the scientist taking the data
  • institutename of the institute
  • addressthe address of the institute where the scientist
  • cruisename of cruise
  • mooringmooring number or name
  • datedate of lowering of CTD into the water
  • latitudelatitude, as a character string
  • latitude.declatitude, in decimal degrees positive north of equator
  • longitudelongitude, as a character string
  • longitude.declongitude, in decimal degrees, positive if east of Greenwich and west of dateline
  • recoverydate of recovery of CTD
  • sample.intervaltime interval between samples [s]
  • water.depththe water depth at the site [m]
  • processing.logA processing log.
  • dataA 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.

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.

References

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

See Also

summary.ctd

Examples

Run this code
library(oce)
prof <- read.ctd("/usr/local/lib/R/library/oce/demo/ctdprofile.cnv")
attach(prof)
plot(t, pressure) # T profile

Run the code above in your browser using DataLab