Package pygeodesy3 :: Package earth
[frames] | no frames]

Package earth

Classes and functions to model the earth by datum, bi- or triaxial ellipsoid or sphere.


Version: 23.12.18

Submodules

Classes
  BetaOmega2Tuple
2-Tuple (beta, omega) with ellipsoidal lat- and longitude beta and omega both in Radians (or Degrees).
  BetaOmega3Tuple
3-Tuple (beta, omega, height) with ellipsoidal lat- and longitude beta and omega both in Radians (or Degrees) and the height, rather the (signed) distance to the triaxial's surface (measured along the radial line to the triaxial's center) in meter, conventionally.
  Circle4Tuple
4-Tuple (radius, height, lat, beta) of the radius and height, both conventionally in meter of a parallel circle of latitude at (geodetic) latitude lat and the parametric (or reduced) auxiliary latitude beta, both in degrees90.
  Curvature2Tuple
2-Tuple (meridional, prime_vertical) of radii of curvature, both in meter, conventionally.
  Datum
Ellipsoid and transform parameters for an earth model.
  Ecef9Tuple
9-Tuple (x, y, z, lat, lon, height, C, M, datum) with geocentric x, y and z plus geodetic lat, lon and height, case C (see the Ecef*.reverse methods) and optionally, the rotation matrix M (EcefMatrix) and datum, with lat and lon in degrees and x, y, z and height in meter, conventionally.
  EcefError
An ECEF or Ecef* related issue.
  EcefFarrell21
Conversion between geodetic and geocentric, Earth-Centered, Earth-Fixed (ECEF) coordinates based on Jay A. Farrell's Table 2.1, page 29.
  EcefFarrell22
Conversion between geodetic and geocentric, Earth-Centered, Earth-Fixed (ECEF) coordinates based on Jay A. Farrell's Table 2.2, page 30.
  EcefKarney
Conversion between geodetic and geocentric, Earth-Centered, Earth-Fixed (ECEF) coordinates transcoded from Karney's C++ Geocentric methods.
  EcefMatrix
A rotation matrix known as East-North-Up (ENU) to ECEF.
  EcefSudano
Conversion between geodetic and geocentric, Earth-Centered, Earth-Fixed (ECEF) coordinates based on John J. Sudano's paper.
  EcefVeness
Conversion between geodetic and geocentric, Earth-Centered, Earth-Fixed (ECEF) coordinates transcoded from Chris Veness' JavaScript classes LatLonEllipsoidal, Cartesian.
  EcefYou
Conversion between geodetic and geocentric, Earth-Centered, Earth-Fixed (ECEF) coordinates using Rey-Jer You's transformation for non-prolate ellipsoids.
  Ellipsoid
Ellipsoid with equatorial and polar radii, flattening, inverse flattening and other, often used, cached attributes, supporting oblate and prolate ellipsoidal and spherical earth models.
  Ellipsoid2
An Ellipsoid specified by equatorial radius and flattening.
  Jacobi2Tuple
2-Tuple (x, y) with a Jacobi Conformal x and y projection, both in Radians (or Degrees).
  JacobiConformal
This is a conformal projection of a triaxial ellipsoid to a plane in which the X and Y grid lines are straight.
  JacobiConformalSpherical
An alternate, spherical JacobiConformal projection.
  RefFrame
Terrestrial Reference Frame (TRF) parameters.
  TRFXform
A Terrestrial Reference Frame (TRF) converter between two reference frames observed at an epoch.
  TRFXform7Tuple
7-Tuple (tx, ty, tz, s, sx, sy, sz) of conversion parameters with translations tx, ty and tz in milli-meter, scale s in ppb and rates sx, sy and sz in milli-arc-seconds-per-year.
  Transform
Helmert datum transformation.
  TransformXform
Helmert transformation, extended with an Xform TRF converter.
  Triaxial
Ordered triaxial ellipsoid.
  TriaxialError
Raised for Triaxial issues.
  Triaxial_
Unordered triaxial ellipsoid and base class.
  a_f2Tuple
2-Tuple (a, f) specifying an ellipsoid by equatorial radius a in meter and scalar flattening f.
Functions
 
a_b2e(a, b)
Return e, the 1st eccentricity for a given equatorial and polar radius.
 
a_b2e2(a, b)
Return e2, the 1st eccentricity squared for a given equatorial and polar radius.
 
a_b2e22(a, b)
Return e22, the 2nd eccentricity squared for a given equatorial and polar radius.
 
a_b2e32(a, b)
Return e32, the 3rd eccentricity squared for a given equatorial and polar radius.
 
a_b2f(a, b)
Return f, the flattening for a given equatorial and polar radius.
 
a_b2f2(a, b)
Return f2, the 2nd flattening for a given equatorial and polar radius.
 
a_b2f_(a, b)
Return f_, the inverse flattening for a given equatorial and polar radius.
 
a_b2n(a, b)
Return n, the 3rd flattening for a given equatorial and polar radius.
 
a_f2b(a, f)
Return b, the polar radius for a given equatorial radius and flattening.
 
a_f_2b(a, f_)
Return b, the polar radius for a given equatorial radius and inverse flattening.
 
b_f2a(b, f)
Return a, the equatorial radius for a given polar radius and flattening.
 
b_f_2a(b, f_)
Return a, the equatorial radius for a given polar radius and inverse flattening.
 
date2epoch(year, month, day)
Return the epoch for a calendar day.
 
e22f(e2)
Return f, the flattening for a given 1st eccentricity squared.
 
e2f(e)
Return f, the flattening for a given 1st eccentricity.
 
epoch2date(epoch)
Return the date for a reference frame epoch.
 
f2e2(f)
Return e2, the 1st eccentricity squared for a given flattening.
 
f2e22(f)
Return e22, the 2nd eccentricity squared for a given flattening.
 
f2e32(f)
Return e32, the 3rd eccentricity squared for a given flattening.
 
f2f2(f)
Return f2, the 2nd flattening for a given flattening.
 
f2f_(f)
Return f_, the inverse flattening for a given flattening.
 
f2n(f)
Return n, the 3rd flattening for a given flattening.
 
f_2f(f_)
Return f, the flattening for a given inverse flattening.
 
hartzell4(pov, los=True, tri_biax=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran..., name='')
Compute the intersection of a tri-/biaxial ellipsoid and a Line-Of-Sight from a Point-Of-View outside.
 
n2e2(n)
Return e2, the 1st eccentricity squared for a given 3rd flattening.
 
n2f(n)
Return f, the flattening for a given 3rd flattening.
 
n2f_(n)
Return f_, the inverse flattening for a given 3rd flattening.
 
trfTransform0(reframe, reframe2, epoch=None, epoch2=None, indirect=True, inverse=True, exhaust=False)
Get a Helmert transform to convert one reframe observed at epoch to an other reframe2 at observed at epoch2 or epoch.
 
trfTransforms(reframe, reframe2, epoch=None, epoch2=None, indirect=True, inverse=True, exhaust=False)
Yield all Helmert transform to convert one reframe observed at epoch to an other reframe2 at observed at epoch2 or epoch.
 
trfXform(reframe1, reframe2, epoch=None, xform=None, rates=None, raiser=True)
Define a new Terrestrial Reference Frame (TRF) converter or get an existing one.
Variables
  __getattr__ = _lazy_import_as(__name__)
  Datums = Datums.OSGB36: Datum(name='OSGB36', ellipsoid=Ellipso...
  Ellipsoids = Ellipsoids.Sphere: Ellipsoid(name='Sphere', a=637...
  RefFrames = RefFrames.ETRF89: RefFrame(name='ETRF89', epoch=19...
  Transforms = Transforms.OSGB36: Transform(name='OSGB36', tx=-4...
  Triaxials =
Function Details

a_b2e (a, b)

 

Return e, the 1st eccentricity for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The unsigned, (1st) eccentricity (float or 0), sqrt(1 - (b / a)**2).

Note: The result is always non-negative and 0 for near-spherical ellipsoids.

a_b2e2 (a, b)

 

Return e2, the 1st eccentricity squared for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The signed, (1st) eccentricity squared (float or 0), 1 - (b / a)**2.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_b2e22 (a, b)

 

Return e22, the 2nd eccentricity squared for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The signed, 2nd eccentricity squared (float or 0), (a / b)**2 - 1.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_b2e32 (a, b)

 

Return e32, the 3rd eccentricity squared for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The signed, 3rd eccentricity squared (float or 0), (a**2 - b**2) / (a**2 + b**2).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_b2f (a, b)

 

Return f, the flattening for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The flattening (scalar or 0), (a - b) / a.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_b2f2 (a, b)

 

Return f2, the 2nd flattening for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The signed, 2nd flattening (scalar or 0), (a - b) / b.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_b2f_ (a, b)

 

Return f_, the inverse flattening for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The inverse flattening (scalar or 0), a / (a - b).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_b2n (a, b)

 

Return n, the 3rd flattening for a given equatorial and polar radius.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • b - Polar radius (scalar > 0).
Returns:
The signed, 3rd flattening (scalar or 0), (a - b) / (a + b).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

a_f2b (a, f)

 

Return b, the polar radius for a given equatorial radius and flattening.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The polar radius (float), a * (1 - f).

a_f_2b (a, f_)

 

Return b, the polar radius for a given equatorial radius and inverse flattening.

Arguments:
  • a - Equatorial radius (scalar > 0).
  • f_ - Inverse flattening (scalar >>> 1).
Returns:
The polar radius (float), a * (f_ - 1) / f_.

b_f2a (b, f)

 

Return a, the equatorial radius for a given polar radius and flattening.

Arguments:
  • b - Polar radius (scalar > 0).
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The equatorial radius (float), b / (1 - f).

b_f_2a (b, f_)

 

Return a, the equatorial radius for a given polar radius and inverse flattening.

Arguments:
  • b - Polar radius (scalar > 0).
  • f_ - Inverse flattening (scalar >>> 1).
Returns:
The equatorial radius (float), b * f_ / (f_ - 1).

date2epoch (year, month, day)

 

Return the epoch for a calendar day.

Arguments:
  • year - Year of the date (scalar).
  • month - Month in the year (scalar, 1..12).
  • day - Day in the month (scalar, 1..31).
Returns:
Epoch, the fractional year (float).
Raises:
  • TRFError - Invalid year, month or day.

Note: Any year is considered a leap year, i.e. having 29 days in February.

e22f (e2)

 

Return f, the flattening for a given 1st eccentricity squared.

Arguments:
  • e2 - The (1st) eccentricity squared, signed (NINF < float < 1)
Returns:
The flattening (float or 0), e2 / (sqrt(e2 - 1) + 1).

e2f (e)

 

Return f, the flattening for a given 1st eccentricity.

Arguments:
  • e - The (1st) eccentricity (0 <= float < 1)
Returns:
The flattening (scalar or 0).

See Also: Function e22f.

epoch2date (epoch)

 

Return the date for a reference frame epoch.

Arguments:
  • epoch - Fractional year (scalar).
Returns:
3-Tuple (year, month, day).
Raises:

Note: Any year is considered a leap year, i.e. having 29 days in February.

f2e2 (f)

 

Return e2, the 1st eccentricity squared for a given flattening.

Arguments:
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The signed, (1st) eccentricity squared (float < 1), f * (2 - f).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

See Also: Eccentricity conversions and Flattening.

f2e22 (f)

 

Return e22, the 2nd eccentricity squared for a given flattening.

Arguments:
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The signed, 2nd eccentricity squared (float > -1 or INF), f * (2 - f) / (1 - f)**2.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

See Also: Eccentricity conversions.

f2e32 (f)

 

Return e32, the 3rd eccentricity squared for a given flattening.

Arguments:
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The signed, 3rd eccentricity squared (float), f * (2 - f) / (1 + (1 - f)**2).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

See Also: Eccentricity conversions.

f2f2 (f)

 

Return f2, the 2nd flattening for a given flattening.

Arguments:
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The signed, 2nd flattening (scalar or INF), f / (1 - f).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

See Also: Eccentricity conversions and Flattening.

f2f_ (f)

 

Return f_, the inverse flattening for a given flattening.

Arguments:
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The inverse flattening (scalar or 0), 1 / f.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

f2n (f)

 

Return n, the 3rd flattening for a given flattening.

Arguments:
  • f - Flattening (scalar < 1, negative for prolate).
Returns:
The signed, 3rd flattening (-1 <= float < 1), f / (2 - f).

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

See Also: Eccentricity conversions and Flattening.

f_2f (f_)

 

Return f, the flattening for a given inverse flattening.

Arguments:
  • f_ - Inverse flattening (scalar >>> 1).
Returns:
The flattening (scalar or 0), 1 / f_.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

hartzell4 (pov, los=True, tri_biax=Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transform=Tran..., name='')

 

Compute the intersection of a tri-/biaxial ellipsoid and a Line-Of-Sight from a Point-Of-View outside.

Arguments:
Returns:
Vector4Tuple(x, y, z, h) on the tri-/biaxial's surface, with h the distance from pov to (x, y, z) along the los, all in meter, conventionally.
Raises:
  • TriaxialError - Invalid pov or pov inside the tri-/biaxial or invalid los or los points outside or away from the tri-/biaxial.
  • TypeError - Invalid tri_biax, ellipsoid or datum.

n2e2 (n)

 

Return e2, the 1st eccentricity squared for a given 3rd flattening.

Arguments:
  • n - The 3rd flattening (-1 <= scalar < 1).
Returns:
The signed, (1st) eccentricity squared (float or NINF), 4 * n / (1 + n)**2.

Note: The result is positive for oblate, negative for prolate or 0 for near-spherical ellipsoids.

See Also: Flattening.

n2f (n)

 

Return f, the flattening for a given 3rd flattening.

Arguments:
  • n - The 3rd flattening (-1 <= scalar < 1).
Returns:
The flattening (scalar or NINF), 2 * n / (1 + n).

n2f_ (n)

 

Return f_, the inverse flattening for a given 3rd flattening.

Arguments:
  • n - The 3rd flattening (-1 <= scalar < 1).
Returns:
The inverse flattening (scalar or 0), 1 / f.

See Also: n2f and f2f_.

trfTransform0 (reframe, reframe2, epoch=None, epoch2=None, indirect=True, inverse=True, exhaust=False)

 

Get a Helmert transform to convert one reframe observed at epoch to an other reframe2 at observed at epoch2 or epoch.

Returns:
A TransformXform instance, a 0-tuple for unity, identity or None if no conversion exists.

See Also: Function trfTransforms for futher details.

trfTransforms (reframe, reframe2, epoch=None, epoch2=None, indirect=True, inverse=True, exhaust=False)

 

Yield all Helmert transform to convert one reframe observed at epoch to an other reframe2 at observed at epoch2 or epoch.

Arguments:
  • reframe - The frame to convert from (RefFrame or str).
  • reframe2 - The frame to convert to (RefFrame or str).
  • epoch - Epoch to observe from (Epoch, scalar or str), otherwise reframe's epoch.
  • epoch2 - Optional epoch to observe to observe to (Epoch, scalar or str), otherwise epoch or reframe's epoch.
  • indirect - If True, include transforms via one intermediate reframe, otherwise only direct reframe to reframe2 transforms (bool).
  • inverse - If True, include inverse, otherwise only forward transforms (bool).
  • exhaust - If True, exhaustively generate all transforms, forward and inverse and via any number of intermediate reframes (bool).
Returns:
A TransformXform instance for each available conversion, without duplicates.
Raises:
  • TRFError - Invalid reframe, reframe2, epoch or epoch2.
  • TypeError - Invalid reframe or reframe2.

trfXform (reframe1, reframe2, epoch=None, xform=None, rates=None, raiser=True)

 

Define a new Terrestrial Reference Frame (TRF) converter or get an existing one.

Arguments:
  • reframe1 - Source frame (RefFrame or str), converting from.
  • reframe2 - Destination frame (RefFrame or str), converting to.
  • epoch - Epoch, a fractional year (Epoch, scalar or str) or None for reframe2's epoch.
  • xform - Transform parameters (TRFXform7Tuple).
  • rates - Rate parameters (TRFXform7Tuple), as xform, but in units-per-year.
  • raiser - If False, do not raise an error if the converter exists, replace it (bool).
Returns:
The new TRF converter (TRFXform) or if no epoch, xform and rates are given, return the existing one (TRFXform) or None if not available.
Raises:
  • TRFError - Invalid reframe1, reframe2, epoch, xform or rates or the TRF converter already exists.

Variables Details

Datums

Value:
Datums.OSGB36: Datum(name='OSGB36', ellipsoid=Ellipsoids.Airy1830, tra\
nsform=Transforms.OSGB36),
Datums.GRS80: Datum(name='GRS80', ellipsoid=Ellipsoids.GRS80, transfor\
m=Transforms.WGS84),
Datums.WGS84: Datum(name='WGS84', ellipsoid=Ellipsoids.WGS84, transfor\
m=Transforms.WGS84),
Datums.Sphere: Datum(name='Sphere', ellipsoid=Ellipsoids.Sphere, trans\
form=Transforms.WGS84)

Ellipsoids

Value:
Ellipsoids.Sphere: Ellipsoid(name='Sphere', a=6371008.771415, b=637100\
8.771415, f_=0, f=0, f2=0, n=0, e=0, e2=0, e21=1, e22=0, e32=0, A=6371\
008.771415, L=10007557.17611675, R1=6371008.771415, R2=6371008.771415,\
 R3=6371008.771415, Rbiaxial=6371008.771415, Rtriaxial=6371008.771415)\
,
Ellipsoids.GRS80: Ellipsoid(name='GRS80', a=6378137, b=6356752.3141403\
5, f_=298.2572221, f=0.00335281, f2=0.00336409, n=0.00167922, e=0.0818\
1919, e2=0.00669438, e21=0.99330562, e22=0.0067395, e32=0.00335843, A=\
...

RefFrames

Value:
RefFrames.ETRF89: RefFrame(name='ETRF89', epoch=1989, datum=Datums.GRS\
80),
RefFrames.NAD83cors96: RefFrame(name='NAD83cors96', epoch=1997, datum=\
Datums.GRS80),
RefFrames.GDA2020: RefFrame(name='GDA2020', epoch=2020, datum=Datums.G\
RS80),
RefFrames.ETRF92: RefFrame(name='ETRF92', epoch=1992, datum=Datums.GRS\
80),
...

Transforms

Value:
Transforms.OSGB36: Transform(name='OSGB36', tx=-446.45, ty=125.16, tz=\
-542.06, s1=1.0, rx=-7.2819e-07, ry=-1.1975e-06, rz=-4.0826e-06, s=20.\
489, sx=-0.1502, sy=-0.247, sz=-0.8421),
Transforms.WGS84: Transform(name='WGS84', tx=0.0, ty=0.0, tz=0.0, s1=1\
.0, rx=0.0, ry=0.0, rz=0.0, s=0.0, sx=0.0, sy=0.0, sz=0.0),
Transforms.Identity: Transform(name='Identity', tx=0.0, ty=0.0, tz=0.0\
, s1=1.0, rx=0.0, ry=0.0, rz=0.0, s=0.0, sx=0.0, sy=0.0, sz=0.0)