Learn R Programming

oce (version 0.8-6)

read.pt: Read an TDR temperature-depth recorder data file

Description

Read an pt temperature-depth recorder file, producing an object of type pt.

Usage

read.pt(file, from=1, to, by=1, type, tz=getOption("oceTz"),
        processingLog, debug=getOption("oceDebug"))

Arguments

file
a connection or a character string giving the name of the file to load.
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.
tz
time zone. The default value, oceTz, is set to UTC at setup.
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

  • An object of class "pt", which is a list with elements detailed below.
  • dataa data table containing the time, temperature, and pressure data.
  • metadataa list containing the following items [object Object],[object Object],[object Object],[object Object]
  • processingLoga processingLog of processing, in the standard oce format.

Implementation notes

The end time for measurement (metadata$measurement.start) is inferred from the Logger time field in the header, not from Logging end. The datasets available to the author suggest this is the proper scheme when the recorders are turned off manually before the end time that was programmed in. In other cases, the assumption may or may not be correct. Still, the end time for subsampling (metdata$subsample.end) should be correct.

Details

Read an TDR (temperature-depth recorder) file. 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) a new (and possibly still changeable) SQLite-based database format.

See Also

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

Examples

Run this code
pt <- read.pt("sl08_011855.dat", by=600)
save(pt, file="oce/data/pt.rda")

Run the code above in your browser using DataLab