Package pygeodesy :: Module datum :: Class Ellipsoid
[frames] | no frames]

Class Ellipsoid

  object --+            
           |            
named._Named --+        
               |        
named._NamedBase --+    
                   |    
named._NamedEnumItem --+
                       |
                      Ellipsoid

Ellipsoid with major and minor radius, semi-axis, (inverse) flattening and other pre-computed, frequently used attributes.

Instance Methods
 
__init__(self, a, b, f_, name='')
New Ellipsoid.
 
__eq__(self, other)
Compare this and an other ellipsoid.
 
distance2(self, lat0, lon0, lat1, lon1)
Approximate the distance and (initial) bearing between two points based on the radii of curvature.
 
ecef(self, Ecef=None)
Return ECEF converter.
 
e2s(self, s)
Compute norm sqrt(1 - e2 * s**2).
 
e2s2(self, s)
Compute 1 - e2 * s**2.
 
es_atanh(self, x)
Compute es * atanh(es * x) where es is the signed 1st Eccentricity.
 
es_tauf(self, taup)
Compute Karney's equations (19), (20) and (21).
 
es_taupf(self, tau)
Compute Karney's equations (7), (8) and (9).
 
m2degrees(self, meter)
Convert distance to angle along equator.
 
Rgeocentric(self, lat)
Compute the geocentric earth radius at the given latitude.
 
Rlat(self, lat)
Approximate the earth radius at the given latitude.
 
roc2(self, lat)
Compute the meridional and prime-vertical radii of curvature at the given latitude.
 
rocBearing(self, lat, bearing)
Compute the directional radius of curvature at the given latitude and compass direction.
 
rocGauss(self, lat)
Compute the Gaussian radius of curvature at the given latitude.
 
rocMean(self, lat)
Compute the mean radius of curvature at the given latitude.
 
rocMeridional(self, lat)
Compute the meridional radius of curvature at the given latitude.
 
rocPrimeVertical(self, lat)
Compute the prime-vertical radius of curvature at the given latitude.
 
toStr(self, prec=9)
Return this ellipsoid as a text string.

Inherited from named._NamedEnumItem: __ne__, unregister

Inherited from named._NamedBase: __repr__, __str__, others, toStr2

Inherited from named._Named: _dot_, attrs, classof, copy

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables
  _f_ = 0
Inverse flattening: a / (a - b) = 1 / f
  _a2_ = None
(1 / a**2) # for ellipsiodalNvector.Cartesian.toNvector
Properties
  a
An immutable property (Read Only).
  a2
An immutable property (Read Only).
  a2_
An immutable property (Read Only).
  a_b
An immutable property (Read Only).
  a2_b
An immutable property (Read Only).
  area
An immutable property (Read Only).
  A
An immutable property (Read Only).
  AlphaKs
An immutable property (Read Only).
  b
An immutable property (Read Only).
  b2
An immutable property (Read Only).
  b2_a
An immutable property (Read Only).
  BetaKs
An immutable property (Read Only).
  c
An immutable property (Read Only).
  e
An immutable property (Read Only).
  e12
An immutable property (Read Only).
  e2
An immutable property (Read Only).
  e22
An immutable property (Read Only).
  e4
An immutable property (Read Only).
  es
An immutable property (Read Only).
  es_c
An immutable property (Read Only).
  f
An immutable property (Read Only).
  f_
An immutable property (Read Only).
  f2
An immutable property (Read Only).
  geodesic
An immutable property (Read Only).
  isEllipsoidal
An immutable property (Read Only).
  isSpherical
An immutable property (Read Only).
  KsOrder
Property to get and set the Krüger series' order (int).
  Mabcd
An immutable property (Read Only).
  n
An immutable property (Read Only).
  R1
An immutable property (Read Only).
  R2
An immutable property (Read Only).
  R3
An immutable property (Read Only).
  Rr
An immutable property (Read Only).
  Rs
An immutable property (Read Only).
  volume
An immutable property (Read Only).

Inherited from named._NamedEnumItem: name

Inherited from named._Named: classname, classnaming, named, named2

Inherited from object: __class__

Method Details

__init__(self, a, b, f_, name='')
(Constructor)

 

New Ellipsoid.

Parameters:
  • a - Semi-major, equatorial axis (meter).
  • b - Semi-minor, polar axis (meter).
  • f_ - Inverse flattening: a / (a - b) (float >>> 1.0).
  • name - Optional, unique name (str).
Raises:
  • NameError - Ellipsoid with that name already exists.
Overrides: object.__init__

__eq__(self, other)
(Equality operator)

 

Compare this and an other ellipsoid.

Parameters:
Returns:
True if equal, False otherwise.

distance2(self, lat0, lon0, lat1, lon1)

 

Approximate the distance and (initial) bearing between two points based on the radii of curvature.

Suitable only for short distances up to a few hundred Km or Miles and only between points not near-polar.

Parameters:
  • lat0 - From latitude (degrees).
  • lon0 - From longitude (degrees).
  • lat1 - To latitude (degrees).
  • lon1 - To longitude (degrees).
Returns:
A Distance2Tuple(distance, initial).

ecef(self, Ecef=None)

 

Return ECEF converter.

Parameters:
Returns:
An ECEF converter for this ellipsoid (EcefKarney, EcefVeness or EcefYou).
Raises:
  • TypeError - Invalid Ecef.

e2s(self, s)

 

Compute norm sqrt(1 - e2 * s**2).

Parameters:
  • s - S value (scalar).
Returns:
Norm (float).
Raises:
  • ValueError - Invalid s.

e2s2(self, s)

 

Compute 1 - e2 * s**2.

Parameters:
  • s - S value (scalar).
Returns:
Result (float).
Raises:
  • ValueError - Invalid s.

es_atanh(self, x)

 

Compute es * atanh(es * x) where es is the signed 1st Eccentricity.

See Also: Function Math::eatanhe.

es_tauf(self, taup)

 

Compute Karney's equations (19), (20) and (21).

See Also: Function Math::tauf.

es_taupf(self, tau)

 

Compute Karney's equations (7), (8) and (9).

See Also: Function Math::taupf.

m2degrees(self, meter)

 

Convert distance to angle along equator.

Parameters:
  • meter - Distance (meter).
Returns:
Angle (degrees).

Rgeocentric(self, lat)

 

Compute the geocentric earth radius at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
Geocentric earth radius (meter).

See Also: Geocentric Radius

Rlat(self, lat)

 

Approximate the earth radius at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
Approximate earth radius (meter).

roc2(self, lat)

 

Compute the meridional and prime-vertical radii of curvature at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
An Curvature2Tuple(meridional, prime_vertical) radii of curvature.

rocBearing(self, lat, bearing)

 

Compute the directional radius of curvature at the given latitude and compass direction.

Parameters:
  • lat - Latitude (degrees90).
  • bearing - Direction (compass degrees360).
Returns:
Directional radius of curvature (meter).

See Also: Radii of Curvature

rocGauss(self, lat)

 

Compute the Gaussian radius of curvature at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
Gaussian radius of curvature (meter).

See Also: Radii of Curvature

rocMean(self, lat)

 

Compute the mean radius of curvature at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
Mean radius of curvature (meter).

See Also: Radii of Curvature

rocMeridional(self, lat)

 

Compute the meridional radius of curvature at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
Meridional radius of curvature (meter).

rocPrimeVertical(self, lat)

 

Compute the prime-vertical radius of curvature at the given latitude.

Parameters:
  • lat - Latitude (degrees90).
Returns:
Prime-vertical radis of curvature (meter).

toStr(self, prec=9)

 

Return this ellipsoid as a text string.

Parameters:
  • prec - Optional number of decimals, unstripped (int).
Returns:
Ellipsoid attributes (str).
Raises:
Overrides: named._Named.toStr

Property Details

a

An immutable property (Read Only).

Get Method:
a(self) - Get the major (equatorial) radius, semi-axis (meter).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

a2

An immutable property (Read Only).

Get Method:
a2(self) - Get the major radius squared (float), a**2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

a2_

An immutable property (Read Only).

Get Method:
a2_(self) - Get the inverse of the major radius squared (float), 1 / a**2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

a_b

An immutable property (Read Only).

Get Method:
a_b(self) - Get ratio a / b (float).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

a2_b

An immutable property (Read Only).

Get Method:
a2_b(self) - Get the polar meridional radius of curvature (meter), a**2 / b.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

area

An immutable property (Read Only).

Get Method:
area(self) - Get the ellipsoid's surface area (meter**2), 4 * PI * R2**2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

A

An immutable property (Read Only).

Get Method:
A(self) - Get the UTM meridional radius (meter).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

AlphaKs

An immutable property (Read Only).

Get Method:
AlphaKs(self) - Get the Krüger Alpha series coefficients (KsOrder-tuple).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

b

An immutable property (Read Only).

Get Method:
b(self) - Get the minor (polar) radius, semi-axis (meter).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

b2

An immutable property (Read Only).

Get Method:
b2(self) - Get the minor radius squared (float), b**2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

b2_a

An immutable property (Read Only).

Get Method:
b2_a(self) - Get the equatorial meridional radius of curvature (meter), b**2 / a.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

BetaKs

An immutable property (Read Only).

Get Method:
BetaKs(self) - Get the Krüger Beta series coefficients (KsOrder-tuple).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

c

An immutable property (Read Only).

Get Method:
c(self) - Get the authalic earth radius (meter), see R2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

e

An immutable property (Read Only).

Get Method:
e(self) - Get the (1st) Eccentricity (float), sqrt(1 - (b / a)**2)).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

e12

An immutable property (Read Only).

Get Method:
e12(self) - Get 1 - e**2 (float).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

e2

An immutable property (Read Only).

Get Method:
e2(self) - Get the (1st) Eccentricity squared (float), f * (2 - f) == 1 - (b / a)**2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

e22

An immutable property (Read Only).

Get Method:
e22(self) - Get the 2nd Eccentricity squared (float), e2 / (1 - e2) == (a / b)**2 - 1.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

e4

An immutable property (Read Only).

Get Method:
e4(self) - Get the (1st) Eccentricity to 4th power (float), e**4 == e2**2.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

es

An immutable property (Read Only).

Get Method:
es(self) - Get the (1st) Eccentricity signed (float).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

es_c

An immutable property (Read Only).

Get Method:
es_c(self) - Get (1 - f) * exp(es_atanh(1)) float.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

f

An immutable property (Read Only).

Get Method:
f(self) - Get the Flattening (float), (a - b) / a.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

f_

An immutable property (Read Only).

Get Method:
f_(self) - Get the Inverse flattening (float), 1 / f == a / (a - b).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

f2

An immutable property (Read Only).

Get Method:
f2(self) - Get the 2nd Flattening (float), (a - b) / b.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

geodesic

An immutable property (Read Only).

Get Method:
geodesic(self) - Get this ellipsoid's Karney Geodesic, provided the GeographicLib package is installed.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

isEllipsoidal

An immutable property (Read Only).

Get Method:
isEllipsoidal(self) - Check whether this model is ellipsoidal (bool).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

isSpherical

An immutable property (Read Only).

Get Method:
isSpherical(self) - Check whether this model is spherical (bool).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

KsOrder

Property to get and set the Krüger series' order (int).

Get Method:
KsOrder(self) - Get the Krüger series order (int 4, 6 or 8).
Set Method:
KsOrder(self, order) - Set the Krüger series' order.

Mabcd

An immutable property (Read Only).

Get Method:
Mabcd(self) - Get the OSGR meridional coefficients (4-tuple), Airy130 only.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

n

An immutable property (Read Only).

Get Method:
n(self) - Get the 3rd Flattening (float), f / (2 - f) == (a - b) / (a + b).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

R1

An immutable property (Read Only).

Get Method:
R1(self) - Get the mean earth radius per IUGG (meter), (2 * a + b) / 3.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

R2

An immutable property (Read Only).

Get Method:
R2(self) - Get the authalic earth radius (meter), sqrt((a**2 + b**2 * atanh(e) / e) / 2).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

R3

An immutable property (Read Only).

Get Method:
R3(self) - Get the volumetric earth radius (meter), (a * a * b)**(1/3).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

Rr

An immutable property (Read Only).

Get Method:
Rr(self) - Get the rectifying earth radius (meter), ((a**(3/2) + b**(3/2)) / 2)**(2/3).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

Rs

An immutable property (Read Only).

Get Method:
Rs(self) - Get another mean earth radius (meter), sqrt(a * b).
Set Method:
immutable(inst, value) - Throws an AttributeError, always.

volume

An immutable property (Read Only).

Get Method:
volume(self) - Get the ellipsoid's volume (meter**3), 4 / 3 * PI * a**2 * b.
Set Method:
immutable(inst, value) - Throws an AttributeError, always.