Learn R Programming

oce (version 0.2-1)

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, tz=getOption("oceTz"), 
        history, 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
tz
time zone. The default value, oceTz, is set to UTC at setup.
history
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]
  • historya history 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, three styles are understood: (1) a two-column style, containing temperature and pressure (in which case time is inferred from information in the header); (2) a four-column style, in which the date the time of day are given in the first two columns, followed by the temperature, and pressure; and (3) a five-column style, in which depth in the water column is given after the pressure.

See Also

The generic function read.oce provides an alternative to this. Objects of type pt can be plotted with plot.pt, and summarized with summary.pt, both of which are generic functions. In-air samples (collected before and after deployment) may be removed in a crude way with ptTrim, but the best scheme is to use subset.oce, based on a temporal window. Removal of the atmospheric component of pressure is best done by the user, using measured records of atmospheric pressure. However, if such data are unavailable, and if the p-T data set contains pre- and post-deployment data, ptPatm may provide a useful estimate of atmospheric pressure.

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