read.ctd(file, type="SBE19", debug=FALSE,
columns=NULL, check.human.headers=TRUE)SBE19 stands for the Seabird 19 CTD.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 "salctd 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: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.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.summary.ctdlibrary(oce)
prof <- read.ctd("/usr/local/lib/R/library/oce/demo/ctdprofile.cnv")
attach(prof)
plot(t, pressure) # T profileRun the code above in your browser using DataLab