| read.pt {oce} | R Documentation |
Read an pT temperature-depth recorder file, producing an object of type pt.
read.pt(file, tz=getOption("oce.tz"), log.action, debug=getOption("oce.debug"))
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 "pt", which is a
list with elements detailed below.
data |
a data table containing the time,
temperature, and 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 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 pt.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(pt)
# trim automatically
pt.trim.auto <- pt.trim(pt)
# trim manually
plot(pt, 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")
pt.trim.manual <- subset(pt, as.POSIXct("2008-06-25 15:00:00") <= time &
time <= as.POSIXct("2008-07-04 12:00:00"))
plot(pt.trim.manual)