ctd.read.ctd(file, type=NULL, debug=FALSE,
columns=NULL, station="", check.human.headers=FALSE)NULL, then the first line is studied, in order to determine the file type. If type="SBE19", then a Seabird 19 (or similar) CTD
format is assumed. If type="WOCE" then a
WOCE-exchange file is assumed.TRUE to turn on debugging.NULL, then 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"
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. The returned list is as follows, but the reader
is cautioned that some items may be blank for some file formats.data$pressure,
data$salinity, data$temperature, and data$sigma.
Note that data$sigma is calculated
from the pressure, salinity, and temperature in the file, using
sw.sigma. read.ctd does a reasonable job of inferring meta-information
from file headers, but it still has limitations. 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. Similarly,
read.ctd can be challenged in parsing latitudes and longitudes
in the wide variety of ways that humans choose. Still, such limitations
are not really pressing in practice, since the ctd object is made available
for manipulation. If read.ctd cannot scan 33 and a third as a latitude,
just examine the header (stored as a list in object$header), and do something
like object$latitude <- 33 + 1/3.
It should be noted that different file types provide different meta-information.
For example, the WOCE exchange format binds together the institute name and the initials
of the chief scientist into a single string that read.ctd cannot parse, so
both object$institute and object$scientist are left blank for WOCE files.
The WOCE-exchange format is described at
read.oce provides an alternative to this.A ctd object may be summarized with summary.ctd and plotted
with plot.ctd.
library(oce)
x <- read.ctd("/usr/local/lib/R/library/oce/demo/ctdprofile.cnv")
plot(x) # summary with TS and profiles
plot.TS(x) # just the TSRun the code above in your browser using DataLab