How is a coordinate transformation done?
FollowRaw velocity measurements are given in beam coordinates, which is a vector in the direction along each of the beams. Depending on the objective of the measurements, coordinate transformation may be beneficial. Beam coordinates can be converted to a Cartesian coordinate system (XYZ) or Earth normal coordinates (ENU: East, North and Up). The orientation of the beams/transducers, which is defined in the instrument specific transformation matrix, is used to convert from beam coordinates to XYZ. By additionally knowing the orientation in space, such as tilt and compass heading, ENU coordinates can be determined.
During transformation to ENU only the slanted beams are used in the transformation. The data represented in ENU originates only from these beams, and the center beam (if collecting current data) is given individually and always in beam coordinates.
If the instrument is configured to measure data in XYZ or ENU, this coordinate transformation is automatically performed by the firmware and the output data will be in the selected coordinate system. The transformation can also be done in post-processing software. If the data is collected in beam coordinates, the transformation can also be carried out manually if desired. How the manual transformation from beam coordinates through XYZ to ENU is done is described below for each type of instrument.
Figure 1: The three relevant coordinate systems. The figure shows an AWAC, but this applies to the other instruments as well.
3-beam instruments
The starting point is a binary-to-ASCII conversion of the raw data file so that you have access to the three velocity files,*.v1
, *.v2
and *.v3
, the transformation matrix in the *.hdr
file, and the *.sen
file. Heading, pitch and roll are presented in the *.sen
file (ref. the *.hdr
file), and these angles are output in degrees. The velocity data in .*.v1
, *.v2
and *.v3
are measured in of the the 3 coordinate systems described above - Beam, XYZ or ENU. The coordinate system selected during the deployment planning is indicated in the *.hdr
file.
Each instrument has its own unique transformation matrix T, based on the transducer geometry. It is used to transform raw data collected in BEAM coordinates to XYZ coordinates.
It's location for each instrument type is described in this FAQ: Where to find the transformation matrix?
Beam to XYZ:
The transformation between beam and XYZ coordinates is done using the original T matrix. In matrix form (using MATLAB notation, so [ X; Y; Z ] is a column vector), the math is:
\begin{equation} T \times [B1;B2;B3;] = [X;Y;Z] \end{equation} |
(1) |
And to convert from XYZ to Beam:
\begin{equation} T^{-1} \times [X;Y;Z;] = [B1;B2;B3;] \end{equation} |
(2) |
Beam or XYZ to ENU:
When transforming to ENU, the transformation matrix T needs to be adjusted depending on the orientation of the instrument. If instrument is pointing down (bit 0 in status equal to 1) rows 2 and 3 must change sign! The default orientation is upward looking!
Next the recorded heading, pitch and roll needs to be taken into account. These are used to create a second matrix R that corrects for the instruments position on earth. Whereas the first matrix is constant throughout the deployment, this one needs to be recalculated for each timestep.
Equation (4) and (5) illustrate how to obtain a matrix for heading, pitch and roll.
\begin{equation} hdg = hdg - 90 \end{equation} \begin{equation}R_z = \begin{bmatrix} |
(4) |
NB: It is necessary to subtract 90° from the recorded heading to account for the instruments x-orientation (Heading of 0° = x pointing North in raw data)
\begin{equation} |
(5) |
\begin{equation} |
(6) |
\begin{equation} |
(7) |
- The following steps outline the transformation from Beam to ENU coordinates:
- Find the instrument specific transformation matrix.
- Make a heading matrix.
- Make a tilt matrix.
- Make a new transformation matrix (R), including heading, pitch and roll.
- The coordinate system transformations can then be carried out using R and T as shown in (8).
- When using the inverse of R / T the transformation can carried out in the opposite direction.
\begin{equation} [ E; N; U ] = R \times T \times[ B1; B2; B3 ] \end{equation} \begin{equation} [ B1; B2; B3 ] = T^{-1} \times R^{-1} \times[ E; N; U ] \end{equation} \begin{equation} [ E; N; U ] = R \times [ X; Y; Z ] \end{equation} \begin{equation} [ X; Y; Z ] = R^{-1} \times [ E; N; U ] \end{equation} |
(8) |
Attached below this page are Python and Matlab scripts that can be used to carry out the above described transformations for a 3-beam system.
Comments
0 comments
Please sign in to leave a comment.