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 authoritative than the former. For example, the inference of cell size
follows advice found at
https://www.nortekusa.com/en/knowledge-center/forum/hr-profilers/736804717
,
which contains a typo in an early posting that is
corrected later on.
read.aquadoppHR(
file,
from = 1,
to,
by = 1,
tz = getOption("oceTz"),
longitude = NA,
latitude = NA,
orientation = orientation,
distance,
monitor = FALSE,
despike = FALSE,
encoding = NA,
processingLog,
debug = getOption("oceDebug"),
...
)
An adp object.
The contents of that object make sense for the particular instrument
type under study, e.g. if the data file contains
NMEA strings, then navigational data will be stored in an item
called nmea
in the data
slot).
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.)
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.
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.
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”.)
character string indicating time zone to be assumed in the data.
optional signed number indicating the longitude in degrees East.
optional signed number indicating the latitude in degrees North.
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"
.
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.
boolean value indicating whether to indicate the progress
of reading the file, by using txtProgressBar()
or otherwise. The value
of monitor
is changed to FALSE
automatically, for non-interactive
sessions.
if TRUE
, despike()
will be used to clean
anomalous spikes in heading, etc.
ignored.
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.)
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.
optional additional arguments that some (but not all)
read.adp.*()
functions pass to lower-level functions.
This file type, like other acoustic-Doppler types, is read with a hybrid R/C++ system, for efficiency. The processing steps are sketched below, for users who want to inspect the code or build upon it.
In R, readBin()
is used to insert the file contents into
a vector of type raw
.
In C++, this raw vector is scanned byte by byte,
to find the starting indices of data "chunks", or subsections of
the data that correspond to individual sampling times.
Checksum computations are also done at this stage, to detect
possible data corruption. Warnings are issued for any bad chunks,
and they are skipped in further processing. The valid
starting points are then passed back to R as a vector of
type integer
.
In R, readBin()
is used to read the components of each chunk.
For speed, this is done in a vectorized fashion. For example,
all the velocities in the whole file are read in a single call
to readBin()
. This process is done for each of the data
fields that are to be handled. Importantly, these readBin()
calls are tailored to the data, using values of
the size
, endian
and signed
parameters that are tailored
to the structure of the given component.
Scaling factors are then applied as required, to convert the
components to physical units.
Finally, in R, the acquired items are inserted into the data
or
metadata
slot of the return value, according to oce convention.
Dan Kelley
Information on Nortek profilers (including the System Integrator Guide,
which explains the data format byte-by-byte) is available at
https://www.nortekusa.com/
. (One must join the site to see the
manuals.)
The Nortek Knowledge Center
https://www.nortekusa.com/en/knowledge-center
may be of help if
problems arise in dealing with data from Nortek instruments.
Other things related to adp data:
[[,adp-method
,
[[<-,adp-method
,
ad2cpCodeToName()
,
ad2cpHeaderValue()
,
adp
,
adp-class
,
adpAd2cpFileTrim()
,
adpConvertRawToNumeric()
,
adpEnsembleAverage()
,
adpFlagPastBoundary()
,
adpRdiFileTrim()
,
adp_rdi.000
,
applyMagneticDeclination,adp-method
,
as.adp()
,
beamName()
,
beamToXyz()
,
beamToXyzAdp()
,
beamToXyzAdpAD2CP()
,
beamToXyzAdv()
,
beamUnspreadAdp()
,
binmapAdp()
,
enuToOther()
,
enuToOtherAdp()
,
handleFlags,adp-method
,
is.ad2cp()
,
plot,adp-method
,
read.adp()
,
read.adp.ad2cp()
,
read.adp.nortek()
,
read.adp.rdi()
,
read.adp.sontek()
,
read.adp.sontek.serial()
,
read.aquadopp()
,
read.aquadoppProfiler()
,
rotateAboutZ()
,
setFlags,adp-method
,
subset,adp-method
,
subtractBottomVelocity()
,
summary,adp-method
,
toEnu()
,
toEnuAdp()
,
velocityStatistics()
,
xyzToEnu()
,
xyzToEnuAdp()
,
xyzToEnuAdpAD2CP()
Other functions that read adp data:
read.adp()
,
read.adp.ad2cp()
,
read.adp.nortek()
,
read.adp.rdi()
,
read.adp.sontek()
,
read.adp.sontek.serial()
,
read.aquadopp()
,
read.aquadoppProfiler()