Last chance! 50% off unlimited learning
Sale ends in
read.odf
is used by read.ctd.odf
for CTD data, etc. As of mid-2015,
read.odf
is still in development, with features being added as a
project with DFO makes available more files.
read.odf(file, columns = NULL, debug = getOption("oceDebug"))
list
that can be used to convert unrecognized
data names to resultant variable names. For example,
columns=list(salinity=list(name="salt", unit=list(unit=expression(), scale="PSS-78"))
states that a short-name of "salt"
represents salinity, and that the unit is
as indicated. This is passed to cnvName2oceName
or ODFNames2oceNames
,
as appropriate, and takes precendence over the lookup table in that function.oce
functions. Generally, setting debug=0
turns off the printing, while higher values suggest that more information
be printed.oce
. It is up to a calling function to determine what to do with this object.
depthMin
, depthMax
and sounding
, which
are inferred from ODF items named MIN_DEPTH
, MAX_DEPTH
and SOUNDING
, respectively. In addition, the more common metadata
item waterDepth
, which is used in ctd
objects to refer to
the total water depth, is set to sounding
if that is finite,
or to maxDepth
otherwise.
ODF2oce
will be an alternative to this, once (or perhaps if) a ODF
package is released by the Canadian Department of Fisheries and Oceans.
library(oce)
odf <- read.odf(system.file("extdata", "CTD_BCD2014666_008_1_DN.ODF", package="oce"))
# Figure 1. make a CTD, and plot (with span to show NS)
plot(as.ctd(odf), span=500, fill='lightgray')
# show levels with bad QC flags
subset(odf, flag!=0)
# Figure 2. highlight bad data on TS diagram
plotTS(odf, type='o') # use a line to show loops
bad <- odf[["flag"]]!=0
points(odf[['salinity']][bad],odf[['temperature']][bad],col='red',pch=20)
Run the code above in your browser using DataLab