.. _showattitude: :mod:`showattitude` =================== .. module:: showattitude :synopsis: SHOW Attitude Solution. .. moduleauthor:: Nick Lloyd , Daniel Letros .. sectionauthor:: Nick Lloyd **Source code:**: `showattitude` SHOW Attitude Solution ---------------------- This module is used to generate the attitude solution required for the SHOW data from the attitude data measured by the ER2 aircraft. The attitude solution is typically injected into the processing stream between Level 1A and Level 1B. Analysis of the SHOW instrument data requires the position and orientation in space of the ER2 aircraft to be known for each exposure taken by SHOW during the ER2 flight. Once the aircraft orientation in space is known an additional rotation matrix provides the instrument lines of sight. The ER2 attitude solution is provided by the ER2 NASDAT system which provides a series of one-line, text records each providing an array of csv (comma separated values):: IWG1Collection,2017-04-22T20:22:19.004,33.897535392,-87.538252378,19341.8,19341.8,62947.5,,197.3,200.3,,0.689,386.0,-45.80,315.5,1.3,1.76,-0.35,,,-62.4,,-42.4,62.3,23.2,315.7,5.5,256.1,,40.7,48.6,-112.4,-64.4 IWG1Collection,2017-04-22T20:22:20.004,33.898800291,-87.539853058,19343.9,19343.9,62955.0,,197.2,200.1,,0.689,416.0,-45.81,315.5,1.4,1.80,-0.26,,,-62.7,,-42.7,62.2,23.2,315.2,5.5,255.9,,40.7,48.5,-112.4,-64.4 IWG1Collection,2017-04-22T20:22:21.004,33.900064725,-87.541454323,19346.1,19346.1,62970.0,,197.1,199.9,,0.688,416.0,-45.83,315.5,1.4,1.72,-0.29,,,-62.7,,-42.7,62.2,23.1,314.7,5.5,253.6,,40.7,48.6,-112.4,-64.4 This format is known as **IWG1Collection** format and is described on the `Nasa Dryden ER2 website `_. The fields of interest to us, along with column index and value extracted from first line of example above are, - Timestamp (1), 2017-04-22T20:22:19.004 - Latitude (2), 33.897535392 - Longitude (3), -87.538252378 - GPS_Alt_MSL (4), 19341.8 - True_Heading (13), -45.80 - Pitch_Angle (16), 1.76 - Roll_Angle (17), -0.35 (i) Global Geocentric Coordinates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The global coordinate system with the origin at the centre of the Earth. This is a right-handed, 3 axis system with - :math:`\hat{x_g}` in the equatorial plane pointing to :math:`0^{\circ}` longitude. - :math:`\hat{y_g}` in the equatorial plane pointing to :math:`90^{\circ}` longitude. - :math:`\hat{z_g}` parallel to the Earth's spin axis. The Earth is assumed to be an oblate spheroid given by the WGS84 specification. This geoid has been intentionally chosen to match the GPS system used to generate the ER2 latitude, longitude and altitude coordinates. (ii) Topocentric Coordinates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is 3 axis, right-handed, orthogonal coordinate system defined for each latitude and longitude on the oblate spheroid. The local topocentric coordinates are: - :math:`\hat{\texttt{north}}` - :math:`\hat{\texttt{east}}` - :math:`\hat{\texttt{down}}` The 3 unit vectors are readily expressed in terms of the global geocentric unit vectors given the latitude and longitude of the ER-2 aircraft measured by the GPS system. Note that we have chosen unit vectors that match the definition normally used in aviation but is opposite to the topocentric unit vectors produced by the sasktran code. (iii) Aircraft Reference Frame ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The aircraft is arbitrarily oriented in the topocentric system and is fully specified by the orientation of 3 unit vectors: - :math:`\hat{\texttt{nose}}`, parallel to the aircraft body pointing forwards through the nose. - :math:`\hat{\texttt{starboard}}`, parallel to the starboard wing. - :math:`\hat{\texttt{wheels}}` parallel to the wheels in the *downward* direction. (iv) True Heading, Pitch and Roll ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The aircraft orientation in space is specified by the IWG1Collection fields, **True Heading**, **Pitch** and **Roll** which are applied as three rotations. Start the rotations with :math:`\hat{\texttt{nose}}`, :math:`\hat{\texttt{starboard}}` and :math:`\hat{\texttt{wheels}}` aligned with :math:`\hat{\texttt{north}}`, :math:`\hat{\texttt{east}}` and :math:`\hat{\texttt{down}}` respectively. - Apply a right-handed rotation around the current :math:`\hat{\texttt{wheels}}` axis of True Heading degrees. - Apply a right-handed rotation around the current :math:`\hat{\texttt{starboard}}` vector of Pitch degrees. - Apply a right handed rotation around the current :math:`\hat{\texttt{nose}}` of Roll degrees. The aircraft orientation in space is now described by the current orientation of :math:`\hat{\texttt{nose}}`, :math:`\hat{\texttt{starboard}}` and :math:`\hat{\texttt{wheels}}` unit vectors. .. image:: figures/pitchangle.png Class IWG1 ^^^^^^^^^^ .. autoclass:: showattitude.iwg1.IWG1 :members: Class IWG1Collection ^^^^^^^^^^^^^^^^^^^^ This is a class that stores a collection of IWG1 lines. The current implementation focusses only on the fields required for the SHOW attitude solution and makes no attempt to support the multitude of other variables broadcast in each IWG1Collection record. Methods ^^^^^^^ The full list of methods is given below but you might find the following links to the most important methods to be convenient - :meth:`~showattitude.iwg1.IWG1Collection.concatentate` - :meth:`~showattitude.iwg1.IWG1Collection.at` - :meth:`~showattitude.iwg1.IWG1Collection.interpolate` .. autoclass:: showattitude.iwg1.IWG1Collection :members: Class WGS84 ^^^^^^^^^^^ .. autoclass:: showattitude.wgs84.WGS84 :members: