read.cm {oce} | R Documentation

## Read a current-meter data file

### Description

Read a current-meter data file, producing an object of type `cm`.

### Usage

    read.cm(file, from=1, to, by=1, tz=getOption("oceTz"),
            type=c("s4"),
            longitude=NA, latitude=NA,
            debug=getOption("oceDebug"), monitor=FALSE, processingLog, ...)

### Arguments

`file` | a connection or a character string giving the name of the file to load.
`from` | index number of the first measurement to be read, or the time of that measurement, as created with `as.POSIXct` (hint: use `tz="UTC"`).
`to` | indication of the last measurement to read, in a format matching that of `from`.

`by`

an indication of the stride length to use while walking through the file. If this is an integer, then `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.

`longitude` | optional signed number indicating the longitude in degrees East.
`latitude` | optional signed number indicating the latitude in degrees North.
`type` | character string indicating type of file (ignored at present).
`tz` | character string indicating time zone to be assumed in the data.
`debug` | a flag that turns on debugging. The value indicates the depth within the call stack to which debugging applies.
`monitor` | ignored at present.
`processingLog` | if provided, the action item to be stored in the log. This parameter is typically only provided for internal calls; the default that it provides is better for normal calls by a user.
`...` | optional arguments passed to plotting functions.

### Details

There is function has been tested on only a single file, and the data-scanning algorithm was based on visual inspection of that file. Whether it will work generally is an open question. It should be noted that the sample file had several odd characteristics, some of which are listed below.

- The file contained two columns named `"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.

- The unit for `"Cond"` was stated in the file to be `"mS"`, which makes no sense, so the unit was assumed to be mS/cm, and the value was divided by the standard value 42.914mS/cm (see Culkin and Smith, 1980), to estimate the conductivity ratio.

- The file contained a column named `"T-Temp"`, which is not something the author has seen in his career. It was assumed to stand for in-situ temperature.

- The file contained a column named `"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`.

- The file contained several columns that lacked names. These were ignored.

- The file contained several columns that seem to be derived from the actual measured data, such as `"Speed"`, `"Dir"`, `"N-S Dist"`, etc. These are ignored.

- The file contained several columns that were basically a mystery to the author, e.g. `"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.

### Value

An object of `class` `"cm"`, which contains measurements made with a current-meter device. The `data` slot will contain `time`, `u` (eastward velocity, converted from cm/s to m/s), `v` (northward velocity, converted from cm/s to m/s) `salinity` (salinity, with the caution that the values in the sample file seem about 6PSU higher than they should be), `temperature` (temperature, assumed in-situ), and `pressure` (pressure, calculated with `swPressure` based on the `"Depth"` column in the file).

`Caution.` The value in the `"Hdg"` file is stored as `heading` in the data, but this is just a guess.

See “Details” for an explanation of why other columns are ignored.

### Author(s)

Dan Kelley

### References

Culkin, F., and Norman D. Smith, 1980. Determination of the concentration of potassium chloride solution having the same electrical conductivity, at 15 C and infinite frequency, as standard seawater of salinity 35.0000 ppt (Chlorinity 19.37394 ppt). IEEE Journal of Oceanic Engineering, 5, pp 22-23.

### See Also

The documentation for `cm-class` explains the structure of `cm` objects, and also outlines the other functions dealing with them.

### Examples

      ## Not run:
        library(oce)
        cm <- read.oce("cm_interocean_0811786.s4a.tab")
        summary(cm)
        plot(cm)

    ## End(Not run)

[Package oce version 0.9-18 Index]