Learn R Programming

oce (version 0.9-17)

read.logger: Read a logger file

Description

Read a logger file, e.g. a temperature-depth recorder, producing an object of class logger.

Usage

read.logger(file, from=1, to, by=1, type,
            tz=getOption("oceTz", default="UTC"), patm=FALSE,
            processingLog, debug=getOption("oceDebug"))

Arguments

file
a connection or a character string giving the name of the file to load. (If it is an RSK logger, file must be a character string, because connections are not used in that case, which is instead handled with database calls.
from
indication of the first datum to read. This can a positive integer to indicate sequence number, the POSIX time of the first datum, or a character string that can be converted to a POSIX time. (For POSIX times, be careful about the tz
to
an indication of the last datum to be read, in the same format as from. If to is missing, data will be read to the end of the file.
by
an indication of the stride length to use while walking through the file. If this is an integer, then by-1 profiles are skipped between each pair of profiles that is read. If this is a string representing a time interval, in col
type
optional file type, presently only permitted to be rsk. If this argument is not provided, an attempt will be made to infer the type from the file name and contents.
tz
time zone. The value oceTz is set at package setup.
patm
controls the handling of atmospheric pressure, an important issue for RBR instruments that record total pressure, i.e. the sum of atmospheric pressure and sea pressure. There are three alternatives. (1) If patm is FAL
processingLog
if provided, the action item to be stored in the log. (Typically only provided for internal calls; the default that it provides is better for normal calls by a user.)
debug
a flag that can be set to TRUE to turn on debugging.

Value

Details

Read a logger file produced by one of several instruments produced by RBR. At the moment, four styles are understood: (1) text file with columns for temperature and pressure (with sampling times indicated in the header); (2) text file with four columns, in which the date the time of day are given in the first two columns, followed by the temperature, and pressure; (3) text file with five columns, in which depth in the water column is given after the pressure; (4) an SQLite-based database format.

It should be noted that RBR loggers record conductivity in mS/cm, and that it is this value that is stored in the object returned by read.logger. This can be converted to conductivity ratio (which is what many other instruments report) by dividing by 42.914, which will be necessary in any seawater-related function that takes conductivity ratio as an argument (see Examples). Another particular aspect of RBR loggers is that they tend to record total pressure (i.e. sea pressure plus atmospheric pressure), many applications will involve an alteration of the pressure. This can be done with the patm argument, of by subtraction of a constant (or vector) after creating the object.

See Also

The documentation for logger-class explains the structure of logger objects, and also outlines other functions dealing with them. See as.ctd for the method of converting to a CTD object.

Examples

Run this code
library(oce)
## A CTD-style logger
logger <- read.logger("cast4.rsk")
patm <- logger[["pressure"]][1]
ctd <- as.ctd(logger, pressureAtmospheric=patm)
plot(ctdTrim(ctd))

Run the code above in your browser using DataLab