read.tdr {oce} | R Documentation |
Read an TDR temperature-depth recorder file, producing an object of type tdr
.
read.tdr(file, tz=getOption("oce.tz"), log.action, debug=FALSE)
file |
a connection or a character string giving the name of the file to load. |
tz |
time zone. The default value, oce.tz , is set to UTC
at setup. |
log.action |
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. |
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.
An object of class
"tdr"
, which is a
list with elements detailed below.
data |
a data table containing the (t, temperature, pressure) data. |
metadata |
a list containing the following items
|
processing.log |
a processing log, in the standard oce format. |
Dan Kelley
The generic function read.oce
provides an
alternative to this. Objects of type tdr
can be plotted
with plot.tdr
, and summarized with
summary.tdr
, both of which are generic functions.
In-air samples (collected before and after deployment) may be removed
in a crude way with tdr.trim
, but the best scheme is
to use subset.oce
, based on a temporal window (see
Examples). Removal of the atmospheric component of pressure is left
up to the user; in many cases, it makes sense to treat this as a
constant (see Examples).
library(oce) data(tdr) # trim automatically tdr.trim.auto <- tdr.trim(tdr) # trim manually plot(tdr, which=2) # try a few times near start of record (15:00:00 seems good) abline(v=as.POSIXct("2008-06-25 00:00:00"),col="red") abline(v=as.POSIXct("2008-06-26 00:00:00"),col="red") abline(v=as.POSIXct("2008-06-25 15:00:00"),col="red") # try a few times near end of record (15:00:00 seems ok) abline(v=as.POSIXct("2008-07-04 00:00:00"),col="blue") abline(v=as.POSIXct("2008-07-05 10:00:00"),col="blue") abline(v=as.POSIXct("2008-07-04 12:00:00"),col="blue") tdr.trim.manual <- subset(tdr, as.POSIXct("2008-06-25 15:00:00") <= t & t <= as.POSIXct("2008-07-04 12:00:00")) plot(tdr.trim.manual)