Learn R Programming

oce (version 0.9-3)

read.adp: Read an ADP data file

Description

Read an ADP data file, producing an object of type adp.

Usage

read.adp(file, from=1, to, by=1, tz=getOption("oceTz"),
  latitude=NA, longitude=NA,
  manufacturer=c("rdi", "nortek", "sontek"),
  monitor=FALSE, despike=FALSE, processingLog,
  debug=getOption("oceDebug"),
  ...)
read.adp.rdi(file, from=1, to, by=1, tz=getOption("oceTz"),
  latitude=NA, longitude=NA,
  type=c("workhorse"),
  monitor=FALSE, despike=FALSE, processingLog,
  debug=getOption("oceDebug"),
  ...)
read.adp.nortek(file, from=1, to, by=1, tz=getOption("oceTz"),
  latitude=NA, longitude=NA,
  type=c("aquadoppHR", "aquadoppProfiler"),
  orientation, distance,
  monitor=FALSE, despike=FALSE, processingLog,
  debug=getOption("oceDebug"),
  ...)
read.adp.sontek(file, from=1, to, by=1, tz=getOption("oceTz"),
  latitude=NA, longitude=NA,
  type=c("adp","pcadp"),
  monitor=FALSE, despike=FALSE, processingLog,
  debug=getOption("oceDebug"),
  ...)
read.adp.sontek.serial(file, from=1, to, by=1, tz=getOption("oceTz"),
  latitude=NA, longitude=NA,
  type=c("adp", "pcadp"),
  beamAngle=25, orientation,
  monitor=FALSE, processingLog,
  debug=getOption("oceDebug"))

Arguments

file
a connection or a character string giving the name of the file to load. (For read.adp.sontek.serial, this is generally a list of files, which will be concatenated.
from
indication of the first profile to read. This can be an integer, the sequence number of the first profile to read, or a POSIXt time before which profiles should be skipped, or a character string that converts to a POSIXt time (assuming UTC ti
to
if supplied, an indication of the last profile to read, in a format as described for from. If not supplied, the whole file will be read.
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
manufacturer
a character string indicating the manufacturer, used by the general function read.adp to select a subsidiary function to use, such as read.adp.nortek.
type
a character string indicating the type of instrument.
orientation
optional character string specifying the orientation of the sensor, provided for those cases in which it cannot be inferred from the data file. The valid choices are "upward", "downward", and "sideward"
distance
optional vector holding the distances of bin centres from the sensor. This argument is ignored except for Nortek profilers, and need not be given if the function determines the distances correctly from the data. The problem is that the
tz
character string indicating time zone to be assumed in the data.
latitude
optional signed number indicating the latitude in degrees North.
longitude
optional signed number indicating the longitude in degrees East.
debug
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.
beamAngle
angle between instrument axis and beams, in degrees.
monitor
boolean, set to TRUE to provide an indication (with numbers and dots) of every profile read.
despike
if TRUE, despike will be used to clean anomalous spikes in heading, etc.
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.)
...
additional arguments, passed to called routines.

Value

  • An object of class "adp", which contains measurements made with an ADP device. The value of metadata$coordinate is set to "beam", a fact that is used in other steps in processing. For information on data stored in the object, see Details.

    There are three types of element stored in the result's data, namely space-series, time-series, and matrix. These are contained within a list named data, as follows: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

    In ADP data files, velocities are coded to signed 2-byte integers, with a scale factor being used to convert to velocity in metres per second. These two facts control the maximum recordable velocity and the velocity resolution, values that may be retrieved for an ADP object name d with d[["velocityMaximum"]] and d[["velocityResolution"]].

Implementation notes

  • Teledyne-RDI files.If a heading bias had been set with theEBcommand during the setup for the deployment, then a heading bias will have been stored in the file's header. This value is stored in the object's metadata asmetadata$heading.bias.Importantly, this value is subtracted from the headings stored in the file, and the result of this subtraction is stored in the objects heading value (indata$heading). It should be noted thatread.adp.rdi()was tested for firmware version 16.30. For other versions, there may be problems. For example, the serial number is not recognized properly for version 16.28.
  • Nortek Aquadopp files.The R code is based on information in the Nortek System Integrator Guide (2008) and on postings on the Nortek ``knowledge center'' discussion board. One might assume that the latter is less authorative than the former. For example, the inference of cell size follows advice found athttp://www.nortekusa.com/en/knowledge-center/forum/hr-profilers/736804717(downloaded June 2012)), which contains a typo in an early posting that is corrected later on.

Details

Reads a binary-format ADP file. Three types can be handled at the moment: the Teledyne-RDI Workhorse instrument using firmware version 16.30 (and, to some extent, also firmware 16.28 and 16.21), the NorTek Aquadopp High Resolution profiler, and SonTek PCADP.

References

1. Teledyne-RDI, 2007. WorkHorse commands and output data format. P/N 957-6156-00 (November 2007). (Section 5.3 h details the binary format, e.g. the file should start with the byte 0x7f repeated twice, and each profile starts with the bytes 0x80, followed by 0x00, followed by the sequence number of the profile, represented as a little-endian two-byte short integer. read.adp.rdi() uses these sequences to interpret data files.)

2. Information on Nortek profilers (including the System Integrator Guide, which explains the data format byte-by-byte) is available at http://www.nortekusa.com/. (One must join the site to see the manuals.)

3. Information about Sontek profilers is available at http://www.sontek.com.

4. The Nortek Knowledge Center http://www.nortekusa.com/en/knowledge-center may be of help if problems arise in dealing with data from Nortek instruments.

See Also

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

Examples

Run this code
library(oce)
# A day sampled at 1/2 hour interval.  Note the timezone.
dir <- "/data/archive/sleiwex/2008/moorings/"
f <- paste(dir, "m09/adp/rdi_2615/raw/adp_rdi_2615.000", sep="")
d <- read.oce(f, from=as.POSIXct("2008-06-26", tz="UTC"),
                 to=as.POSIXct("2008-06-27", tz="UTC"), by="30:00")
summary(d)
plot(d)

Run the code above in your browser using DataLab