Reference Ellipsoid#

class ahrs.utils.ReferenceEllipsoid(a: float = 1.0, f: float = 0.0, GM: float = 6.6743e-11, w: float = 1.0)#

This implementation is based on the World Geodetic System (WGS) reference ellipsoid [198414], which is the most widely used reference ellipsoid for the Global Positioning System (GPS).

The WGS84 uses four elemental parameters to describe a reference ellipsoid:

  • Semi-major axis, \(a\), in meters.

  • Flattening ratio, \(f\).

  • Standard Gravitational Parameter, \(GM\), in m^3/s^2.

  • Angular velocity, \(\omega\), in rad/s.

The semi-major axis, \(a\), is the radius of the ellipsoid at the equator, while the flattening ratio, \(f\), is the ratio of the difference between the semi-major and semi-minor axes to the semi-major axis:

\[f = \frac{a-b}{a}\]

where \(b\) is the semi-minor axis of the ellipsoid. When \(f = 0\) the ellipsoid is a perfect sphere. When \(f = 1\) the ellipsoid is a flat disc.

The standard gravitational parameter, \(GM\), is the product of the gravitational constant and the mass of the planetary body:

\[GM = G \cdot M\]

where \(G = 6.67430 \times 10^{-11} \frac{\mathrm{m}^3}{\mathrm{kg} \mathrm{s}^2}\) is the universal constant of gravitation, and \(M\) is the mass of the planetary body, in kg.

From these four parameters we can derive all other properties of the ellipsoid.

The default values describe a perfect sphere with a radius of 1 meter, whose gravitational constant is equal the universal constant of gravitation, and rotates at 1 rad/s.

Parameters:
  • a (float, default: 1.0) – Semi-major axis of the ellipsoid, in meters.

  • f (float, default: 0.0) – Flattening of the ellipsoid, unitless.

  • GM (float, default: 6.6743e-11) – Standard Gravitational Parameter of the ellipsoid, in m^3/s^2.

  • w (float, default: 1.0) – Angular velocity of the ellipsoid, in rad/s.

property arithmetic_mean_radius: float#

Mean Radius \(R_1\) of the Three Semi-Axes, computed as:

\[R_1 = a\Big(1-\frac{f}{3}\Big)\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.arithmetic_mean_radius
1.0
property aspect_ratio: float#

Aspect Ratio \(AR\), computed as:

\[AR = \frac{b}{a}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.aspect_ratio
1.0
property authalic_sphere_radius: float#

Radius \(R_2\) of a Sphere of Equal Area, computed as:

\[R_2 = R_P \Big(1-\frac{2}{3}e'^2 + \frac{26}{45}e'^4 - \frac{100}{189}e'^6 + \frac{7034}{14175}e'^8 - \frac{220652}{467775}e'^{10} \Big)\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.authalic_sphere_radius
1.0
property curvature_polar_radius: float#

Polar Radius of Curvature \(R_P\), computed as:

\[\begin{split}\begin{array}{ll} R_P &= \frac{a^2}{b} = \frac{a}{\sqrt{1-e^2}} \\ &= \frac{a}{1-f} \end{array}\end{split}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.curvature_polar_radius
1.0
property dynamical_form_factor: float#

WGS 84 Dynamical Form Factor \(J_2\), computed as:

\[J_2 = \frac{e^2}{3} \Big(1-\frac{2me'}{15q_0}\Big)\]

where:

\[q_0 = \frac{1}{2}\Big[\Big(1+\frac{3}{e'^2}\Big)\arctan e' - \frac{3}{e'}\Big]\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.dynamical_form_factor
0.0
property equatorial_normal_gravity: float#

Normal Gravity \(\mathrm{g}_e\) at the Equator, in \(\frac{\mathrm{m}}{\mathrm{s}^2}\), computed as:

\[\mathrm{g}_e = \frac{GM}{ab}\Big(1-m-\frac{me'q_0'}{6q_0}\Big)\]

where:

\[\begin{split}\begin{array}{ll} q_0 &= \frac{1}{2}\Big[\Big(1+\frac{3}{e'^2}\Big)\arctan e' - \frac{3}{e'}\Big] \\ q_0' &= 3\Big[\Big(1+\frac{1}{e'^2}\Big)\Big(1-\frac{1}{e'}\arctan e'\Big)\Big] - 1 \end{array}\end{split}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.equatorial_normal_gravity
14982844642.8839
property equivolumetric_sphere_radius: float#

Radius \(R_3\) of a Sphere of Equal Volume, computed as:

\[\begin{split}\begin{array}{ll} R_3 &= \sqrt[3]{a^2b} \\ &= a\sqrt[3]{1-f} \end{array}\end{split}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.equivolumetric_sphere_radius
1.0
property first_eccentricity_squared: float#

First Eccentricity Squared \(e^2\) of the ellipsoid, computed as:

\[e^2 = 2f - f^2\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.first_eccentricity_squared
0.0
property is_geodetic: bool#

Check whether the ellipsoid model is geodetic (describes planet Earth.)

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.is_geodetic
False
property linear_eccentricity: float#

Linear Eccentricity \(E\), computed as:

\[E = \sqrt{a^2-b^2}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.linear_eccentricity
0.0
property mass: float#

The Mass \(M\) of the ellipsoid, in kg, computed as:

\[M = \frac{GM}{G}\]

where \(G\) is the universal constant of gravitation equal to \(6.67428\times 10^{-11} \frac{\mathrm{m}^3}{\mathrm{kg} \mathrm{s}^2}\)

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.mass
1.0
property mean_normal_gravity: float#

Mean Value \(\bar{\mathrm{g}}\) of Normal Gravity, in \(\frac{\mathrm{m}}{\mathrm{s}^2}\), computed as:

\[\bar{\mathrm{g}} = \mathrm{g}_e\Big(1 + \frac{1}{6}e^2 + \frac{1}{3}k + \frac{59}{360}e^4 + \frac{5}{18}e^2k + \frac{2371}{15120}e^6 + \frac{259}{1080}e^4k + \frac{270229}{1814400}e^8 + \frac{9623}{45360}e^6k \Big)\]

where:

\[k = \frac{b\mathrm{g}_p - a\mathrm{g}_e}{a\mathrm{g}_e} = \frac{b\mathrm{g}_p}{a\mathrm{g}_e}-1\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.mean_normal_gravity
14982844642.8839
meridian_curvature_radius(lat: float) float#

Radius of the curvature in the prime meridian, estimated at a given latitude, \(\phi\), as per [Jek16]:

\[R_M = \frac{a(1-e^2)}{(1-e^2\sin^2\phi)^{\frac{3}{2}}}\]
Parameters:

lat (float) – Geographical latitude, in decimal degrees.

normal_gravity(lat: float, h: float = 0.0) float#

Normal Gravity on (or above) Ellipsoidal Surface

Estimate the normal gravity on or above the surface of an ellipsoidal body using Somigliana’s formula (on surface) and a series expansion (above surface).

Somigliana’s closed formula as desribed by H. Moritz in [Mor84] is:

\[\mathrm{g} = \frac{a\mathrm{g}_e \cos^2\phi + b\mathrm{g}_p\sin^2\phi}{\sqrt{a^2cos^2\phi + b^2\sin^2\phi}}\]

For numerical computations, a more convenient form is:

\[\mathrm{g} = \mathrm{g}_e\frac{1+k\sin^2\phi}{\sqrt{1-e^2\sin^2\phi}}\]

with the helper constant \(k\):

\[k = \frac{b\mathrm{g}_p}{a\mathrm{g}_e}-1\]
Parameters:
  • lat (float) – Geographical latitude, in decimal degrees.

  • h (float, default: 0.0) – Mean sea level height, in meters.

Returns:

g – Normal gravity at given point in space, in m/s^2.

Return type:

float

Examples

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.normal_gravity(50.0)
9.810702135603085
>>> ref.normal_gravity(50.0, 100.0)
9.810393625316983
property normal_gravity_constant: float#

Normal Gravity Formula Constant \(m\), computed as:

\[m = \frac{\omega^2a^2b}{GM}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.normal_gravity_constant
14982844642.8839
property normal_gravity_potential: float#

Normal Gravity Potential \(U_0\) of the WGS 84 Ellipsoid, computed as:

\[U_0 = \frac{GM}{E} \arctan e' + \frac{\omega^2a^2}{3}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.normal_gravity_potential
6.6743e-11
property polar_normal_gravity: float#

Normal Gravity \(\mathrm{g}_p\) at the Pole, in \(\frac{\mathrm{m}}{\mathrm{s}^2}\), computed as:

\[\mathrm{g}_p = \frac{GM}{a^2}\Big(1+\frac{me'q_0'}{3q_0}\Big)\]

where:

\[\begin{split}\begin{array}{ll} q_0 &= \frac{1}{2}\Big[\Big(1+\frac{3}{e'^2}\Big)\arctan e' - \frac{3}{e'}\Big] \\ q_0' &= 3\Big[\Big(1+\frac{1}{e'^2}\Big)\Big(1-\frac{1}{e'}\arctan e'\Big)\Big] - 1 \end{array}\end{split}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.polar_normal_gravity
14982844642.8839
property second_degree_zonal_harmonic: float#

WGS 84 Second Degree Zonal Harmonic \(C_{2,0}\), computed as:

\[C_{2,0} = -\frac{J_2}{\sqrt{5}}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.second_degree_zonal_harmonic
0.0
property second_eccentricity_squared: float#

Second Eccentricity Squared \(e'^2\), computed as:

\[e'^2 = \frac{a^2-b^2}{b^2}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.second_eccentricity_squared
0.0
property sidereal_day: float#

Sidereal Day, \(T_{sid}\), in seconds, computed as:

\[T_{sid} = \frac{2\pi}{\omega}\]

Example

>>> ref = ahrs.utils.ReferenceEllipsoid()
>>> ref.sidereal_day
6.283185307179586
vertical_curvature_radius(lat: float) float#

Radius of the curvature in the prime vertical, estimated at a given latitude, \(\phi\), as:

\[R_N = \frac{a}{\sqrt{1-e^2\sin^2\phi}}\]
Parameters:

lat (float) – Geographical latitude, in decimal degrees.