cm-class
.
read.cm(file, from = 1, to, by = 1, tz = getOption("oceTz"), type = c("s4"), longitude = NA, latitude = NA, debug = getOption("oceDebug"), monitor = FALSE, processingLog, ...)
as.POSIXct
(hint: use
tz="UTC"
).from
.by-1
measurements are skipped between
each pair of profiles that is read. This may not make much sense, if the data
are not equi-spaced in time. If by
is a string representing a time
interval, in colon-separated format, then this interval is divided by the
sampling interval, to get the stride length. BUG: if the data are not
equi-spaced, then odd results will occur.cm-class
.
The data
slot will contain all the data in the file, with names
determined from the tokens in line 3 in that file, passed through
make.names
, except that
Vnorth
is renamed v
(after conversion from cm/s to m/s),
Veast
is renamed u
(after conversion from cm/s to m/s),
Cond
is renamed conductivity
,
T.Temp
is renamed temperature
and
Sal
is renamed salinity
, and a new
column named time
(a POSIX time) is constructed
from the information in the file header, and another named
pressure
is constructed from the column named Depth
.
At least in the single file studied in the creation of this function,
there are some columns that are unnamed in line 3 of the header;
these yield data items with names X
, X.1
, etc.
u
and v
values."Cond"
, which was guessed
to stand for conductivity. Since only the first contained data, the second was
ignored, but this may not be the case for all files.
"Cond"
was stated in the file to be "mS"
,
which makes no sense, so the unit was assumed to be mS/cm.
"T-Temp"
, which is not
something the author has seen in his career. It was assumed to stand for
in-situ temperature.
"Depth"
, which is not something
an instrument can measure. Presumably it was calculated from pressure (with
what atmospheric offset, though?) and so pressure was inferred from it using
swPressure
.
"Speed"
, "Dir"
, "N-S Dist"
,
etc. These are ignored.
"Hx"
, "Hy"
, "Vref"
, etc. These were ignored.
Based on such considerations, read.cm.s4()
reads only the columns that
were reasonably well-understood based on the sample file. Users who need more
columns should contact the author. And a user who could produce a document
explaining the data format would be especially appreciated!
cm
data: [[,cm-method
,
[[<-,cm-method
, as.cm
,
cm-class
, cm
,
plot,cm-method
,
subset,cm-method
,
summary,cm-method
## Not run:
# library(oce)
# cm <- read.oce("cm_interocean_0811786.s4a.tab")
# summary(cm)
# plot(cm)
# ## End(Not run)
Run the code above in your browser using DataLab