Read a CTD file in ODF format
read.ctd.odf( file, columns = NULL, station = NULL, missingValue, deploymentType = "unknown", monitor = FALSE, exclude = NULL, encoding = "latin1", debug = getOption("oceDebug"), processingLog, ... )
either a connection or a character value naming a file.
read.ctd.woce(), this may be a
"*.csv") in which case the return
value is a vector containing CTD objects created by reading the files from
pattern set to the specified wildcard
an optional list that can be used to convert unrecognized
data names to resultant variable names. This is used only by
read.ctd.odf(). For example,
if a data file named salinity as
"SAL", then using
<- read.ctd(f, columns=list( d salinity=list(name="SAL", unit=list(unit=expression(), scale="PSS-78"))))
would assign the
"SAL" column to the
salinity entry in the data
slot of the CTD object returned by the
optional character string containing an identifying name or number for the station. This can be useful if the routine cannot determine the name automatically, or if another name is preferred.
optional missing-value flag; data matching this value will
be set to
NA upon reading. If this is provided, then it overrules any
missing-value flag found in the data. For Seabird (
.cnv) files, there is
usually no need to set
missingValue, because it can be inferred from the
header (typically as -9.990e-29). Set
missingValue=NULL to turn off
missing-value detection, even in
.cnv files that contain missing-value
codes in their headers. If
missingValue is not specified,
then an attempt is made to infer such a value from the data, by testing
whether salinity and/or temperature has a minimum that is under -8 in value;
this should catch common values in files, without false positives. A warning
will be issued in this case, and a note inserted in the processing log of
the return value.
character string indicating the type of deployment. Use
"unknown" if this is not known,
"profile" for a profile (in
which the data were acquired during a downcast, while the device was lowered
into the water column, perhaps also including an upcast;
the device is installed on a fixed mooring,
"tsg") if the device is mounted on a moving vessel, to record
near-surface properties, or
"towyo" if the device is repeatedly
lowered and raised.
boolean, set to
TRUE to provide an indication of
progress. This is useful if
filename is a wildcard.
either a character value holding a regular
expression that is used with
grep() to remove lines from the
header before processing, or
NULL (the default), meaning
not to exclude any such lines. The purpose of this argument
is to solve problems with some files, which can have
thousands of lines that indicate details that are may be of
little value in processing. For example, some files have thousands
of lines that would be excluded by using
exclude="PROCESS='Nulled the .* value" in the function call.
a character value that indicates the encoding to be used for
this data file, if it is textual. The default value for most functions is
"latin1", which seems to be suitable for files containing text written in
English and French.
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
turns off the printing, while higher values suggest that more information
if provided, the action item to be stored in the log. This is typically only provided for internal calls; the default that it provides is better for normal calls by a user.
additional arguments, passed to called routines.
This function returns a ctd object.
read.ctd.odf reads files stored in Ocean Data Format, used in
some Canadian hydrographic databases.
Lacking detailed documentation of the ODF file format, the
read.ctd.odf() functions were crafted based on inspection of data files, and
so some guesses had to be made.
PARAMETER_HEADER chunks describing quality-control flags are
a case in point. These contain
NAME components that
refer to other
PARAMETER_HEADER chunks that hold measured data. However,
those references are not always matched well with the data names, and
even if they do match, the cross-reference syntax used by
the Bedford Institute of Oceanography differs from that used by
l’Institut Maurice-Lamontagne. To simplify coding, it was assumed that
each quality-control sequence applies to the data sequence
immediately preceding it. (This assumption is made in other
It is also prudent to pay attention to the units decoding,
read.odf() handles by calling
Be on the lookout for incorrect temperature scales, which
are sometimes reported with nonstandard strings in ODF files.
Also, note that you may see warnings about conductivity ratios,
which some ODF files incorrectly suggest have dimensions.
For sources that describe the ODF format, see the documentation for the odf class.
Other things related to ctd data:
Other things related to ctd data:
Other things related to odf data: