Learn R Programming

oce (version 1.0-1)

read.ad2cp: Read an AD2CP File

Description

This function, introduced in April 2017, is just a temporary interface for separate interpretation code that lives in the 1219 issue directory. THIS IS ONLY FOR DEVELOPERS.

Usage

read.ad2cp(file, from = 1, to, by = 1, tz = getOption("oceTz"),
  longitude = NA, latitude = NA, orientation, distance,
  monitor = FALSE, despike = 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 timezone). See “Examples”, and make careful note of the use of the tz argument. If from is not supplied, it defaults to 1.

to

an optional indication of the last profile to read, in a format as described for from. As a special case, to=0 means to read the file to the end. If to is not supplied, then it defaults to 0.

by

an optional 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, e.g. the default by=1 means to read all the data. (For RDI files only, there are some extra features to avoid running out of memory; see “Memory considerations”.)

tz

character string indicating time zone to be assumed in the data.

longitude

optional signed number indicating the longitude in degrees East.

latitude

optional signed number indicating the latitude in degrees North.

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 distance is poorly documented in the Nortek System Integrator Guide (2008 edition, page 31), so the function must rely on word-of-mouth formulae that do not work in all cases.

monitor

boolean, set to TRUE to provide an indication of progress in reading the file, either by printing a dot for each profile or by writing a textual progress bar with txtProgressBar.

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.)

debug

a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.

additional arguments, passed to called routines.

Value

An adp object, i.e. one inheriting from adp-class. The form of this object varies with instrument type. In some cases navigational data may be included, e.g. read.adp.rdi can read NMEA strings (which get stored in an item called nmea in the data slot).

See Also

Other things related to adp data: [[,adp-method, [[<-,adp-method, adp-class, adpEnsembleAverage, adp, as.adp, beamName, beamToXyzAdp, beamToXyzAdv, beamToXyz, beamUnspreadAdp, binmapAdp, enuToOtherAdp, enuToOther, handleFlags,adp-method, plot,adp-method, read.adp.nortek, read.adp.rdi, read.adp.sontek.serial, read.adp.sontek, read.adp, read.aquadoppHR, read.aquadoppProfiler, read.aquadopp, rotateAboutZ, setFlags,adp-method, subset,adp-method, summary,adp-method, toEnuAdp, toEnu, velocityStatistics, xyzToEnuAdp, xyzToEnu

Examples

Run this code
# NOT RUN {
f <- "/Users/kelley/Dropbox/oce_ad2cp/labtestsig3.ad2cp"
d <- read.ad2cp(f, 1, 10, 1)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab