xyz.to.enu.adp(x, declination=0, debug=getOption("oce.debug"))"adp".data$ma$v[,,1:3] altered appropriately,
and metadata$oce.orientation changed from xyz to
enu.x$data$ma$v[,,1:3]) into what RDI (1998 pages 11 and 12) calls
"ship", or "righted" components. For example, the z coordinate, which may
point upwards or downwards depending on instrument orientation, is mapped
onto a so-called "mast" coordinate that points more nearly upwards than
downward (as for a righted ship). The other ship coordinates are called
"starboard" and "forward", the meanings of which will be clear to a
mariner. Once the (x,y,z) velocities are converted to ship/righted
velocities, the detailed orientation of the instrument is extracted from
heading, pitch, and roll vectors stored in x$data$ts. As in the
previous step, these may be adjusted to account for instrument type and
upward/downward orientation. The case-by-case details are as follows:
CH and SH
denote cosine and sine of heading (after adjusting for declination), with
similar terms for pitch and roll using second letters P and
R. Then, the rotation matrix is defined byrbind(c( CH*CR + SH*SP*SR, SH*CP, CH*SR - SH*SP*CR), c(-SH*CR + CH*SP*SR, CH*CP, -SH*SR - CH*SP*CR), c( -CP*SR, SP, CP*CR))
This matrix is left-multiplied by a matrix with three rows, the top a
vector of "starboard" values, the middle a vector of "forward" values, and
the bottom a vector of "mast" values. Finally, the columns of
data$ma$v[,,1:3] are filled in with the result of the matrix
multiplication.
read.adp for other functions that relate to objects
of class "adp".