Introduction to coordinate systems
Raw 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 or manually, if desired. How the manual transformation from BEAM coordinates through XYZ to ENU is done is described below.
Figure 1: The three relevant coordinate systems. The figure shows an AWAC, but this applies to the other instruments as well.
Necessary data files
1. Raw data
To carry out a coordinate transformation, it is first necessary to convert the raw *.ad2cp data to *.mat using Signature Deployment.
2. Transformation matrix T
The unique transformation matrix T, which is used to transform collected velocities from the BEAM to XYZ coordinate system can be acquired in multiple ways from a Signature instrument:
- If you have converted your raw data, then the transformation matrix can be found under Config.Average_Beam2xyz / Config.Burst_Beam2xyz in the
*.mat/*.nc - Alternatively, you can open a raw .ad2cp file and navigate to the line that starts with GETFXBURST / GETFXAVG. The individual values represent the elements of the 4x4 matrix as shown in (1). These are commands that can equally be send to the instrument using the terminal which will return the same information.
Example:
GETXFBURST,ROWS=4,COLS=4,M11=1.183,M12=0.000,M13=-1.183,M14=0.000,M21=0.000,M22=1.183,M23=0.000,M24=-1.183,M31=0.552,M32=0.000,M33=0.552,M34=0.000,M41=0.000,M42=0.552,M 43=0.000,M44=0.552
| \begin{equation} M_{4beam} = \begin{bmatrix} M_{11} & M_{12} & M_{13} & M_{14} \\ M_{21} & M_{22} & M_{23}& M_{24} \\ M_{31} & M_{32} & M_{33} & M_{34}\\ M_{41} & M_{42}& M_{43} & M_{44}\\ \end{bmatrix} \end{equation} |
(1) | |||
The instruments orientation needs to be taken into account for each deployment, when transforming to ENU coordinates. If the instrument is pointing down, rows 2, 3 and 4 of the matrix must change sign.
💡 NOTE: This is not necessary if an AHRS is installed!
Beam -> XYZ
Each instrument has its own unique transformation matrix T, based on the transducer geometry. Each row of the matrix represents a component in the instrument’s XYZ coordinate system, starting with X at the top row. Each column represents a beam. The third and fourth rows of the Signature transformation matrix represent the two estimates of vertical velocity (Z1 and Z2) produced by the instrument.
Applying this matrix to the velocity vector in beam coordinates will return the components in the XYZ system:
| \begin{equation} T \times [B1;B2;B3;B4] = [X;Y;Z1;Z2] \end{equation} |
(2) | |||
Beam / XYZ -> ENU
To convert to ENU, 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.
The calculation of this matrix depends on the compass sensor type installed in your instrument. If an AHRS is available, R is provided as the AHRS transformation matrix in the raw data set. Should this not be the case, the heading, pitch and roll (Eulerian angles) are used to account for the instruments orientation.
Obtaining R from the Eulerian angles
Equation (3) - (6) illustrate how to obtain a matrix from the raw heading, pitch and roll parameters.
| \begin{equation} R_x = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos(\text{rll}) &- \sin(\text{rll}) \\ 0& \sin(\text{rll}) & \cos(\text{rll}) \end{bmatrix} \end{equation} |
(3) |
| \begin{equation} R_y = \begin{bmatrix} \cos(\text{pch}) & 0 & \sin(\text{pch}) \\ 0 & 1 & 0 \\ - \sin(\text{pch}) & 0 & \cos(\text{pch}) \end{bmatrix} \end{equation} |
(4) |
|
\begin{equation} hdg = hdg - 90 \end{equation} \begin{equation}R_z = \begin{bmatrix} |
(5) |
💡 NOTE: 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} R = R_Z \times R_Y\times R_X \end{equation} |
(6) | |||
Lastly the 3x3 matrix R obtained from heading, pitch and roll needs to be expanded to 4x4 to account for the 4th beam and thereby the second Z/Up velocity. This is done using equation (7):
| \begin{equation} R_{4beam} = \begin{bmatrix} R_{11} & R_{12} & \frac{R_{13}}{2}& \frac{R_{13}}{2} \\ R_{21} & R_{22} & \frac{R_{23}}{2}& \frac{R_{23}}{2} \\ R_{31} & R_{32} & R_{33}& 0\\ R_{31} & R_{32} & 0& R_{33}\\ \end{bmatrix} \end{equation} |
(7) | |||
Obtaining R from the AHRS
For a comprehensive overview of the AHRS please see this FAQ: Working with an AHRS Its data output is instantaneous heading, pitch, roll, acceleration, magnetometer- and gyro data, and orientation matrices. Both the rotation matrix and heading/pitch/roll provided when equipped with this sensor are based on the quaternions and can be used to carry out coordinate transformation between data in the XYZ to ENU coordinates. We recommend using the matrix directly, since rounding errors are introduced due to multiple transformations when using the Eulerian angles. If choosing to use the transformation matrix, it is not necessary to account for the instruments orientation!
The transformation matrix R which is calculated directly by the AHRS can be found in your dataset under the variable: Average_AHRSRotationMatrix / Burst_AHRSRotationMatrix.
Transforming to ENU
In summary the total coordinate system transformation from BEAM to ENU coordinates can be carried out using the following steps:
- Find the instrument specific transformation matrix T.
- Make a pitch & roll matrix.
- Make a heading 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 (7) - (10).
- 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} | (8) |
| \begin{equation} [ B1; B2; B3 ] = T^{-1} \times R^{-1} \times[ E; N; U ] \end{equation} | (9) |
| \begin{equation} [ E; N; U ] = R \times [ X; Y; Z ] \end{equation} | (10) |
| \begin{equation} [ X; Y; Z ] = R^{-1} \times [ E; N; U ] \end{equation} | (11) |
Attached below this page are Python and Matlab scripts that can be used to carry out the above described transformations for raw Signature data.
💡 NOTE: Correction of motion when working with an AHRS
Additionally to the correction for the bearings of the instrument, it is also possible to correct for its motion . This can be done using the accelerometer output from which the acceleration due to gravity needs to be subtracted. The remaining acceleration integrated over time represents a measure of the instruments translational velocity. When subtracting this from the ENU velocities, the dynamic motion is corrected for.
Updated