Package pygeodesy :: Module geoids :: Class GeoidKarney
[frames] | no frames]

Class GeoidKarney

      object --+                
               |                
    named._Named --+            
                   |            
heights._HeightNamed --+        
                       |        
     heights._HeightBase --+    
                           |    
                  _GeoidBase --+
                               |
                              GeoidKarney

Geoid height interpolator for Karney's GeographicLib Earth Gravitational Model (EGM) geoid egm*.pgm datasets using bilinear or cubic interpolation and caching in pure Python, transcoded from Karney's C++ class Geoid.

Use any of the geoid egm84-, egm96- or egm2008-*.pgm datasets.

Instance Methods
 
__init__(self, egm_pgm, crop=None, datum=None, kind=3, **name_smooth)
New GeoidKarney interpolator.
 
__call__(self, *llis, **wrap_H)
Interpolate the geoid height for one or several locations.
 
height(self, lats, lons, **wrap)
Interpolate the geoid height for one or several lat-/longitudes.
 
highest(self, LatLon=None, full=False)
Return the location and largest height of this geoid.
 
lowest(self, LatLon=None, full=False)
Return the location and lowest height of this geoid.

Inherited from _GeoidBase: __enter__, __exit__, __repr__, __str__, center, close, loweright, lowerleft, lowerright, outside, toStr, upperleft, upperright

Inherited from named._Named: __imatmul__, __matmul__, __rmatmul__, attrs, classof, copy, dup, methodname, rename, renamed, toRepr, toStr2

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

Properties
  dtype

Inherited from _GeoidBase: closed, cropped, endian, hits, kind, knots, mean, nBytes, name, pgm, sizeB, smooth, stdev, u2B

Inherited from heights._HeightBase: numpy, scipy, scipy_interpolate

Inherited from heights._HeightNamed: datum, kmin, wrap

Inherited from named._Named: classname, classnaming, iteration, named, named2, named3, named4, sizeof

Inherited from object: __class__

Method Details

__init__ (self, egm_pgm, crop=None, datum=None, kind=3, **name_smooth)
(Constructor)

 

New GeoidKarney interpolator.

Arguments:
  • egm_pgm - An EGM geoid dataset file name (egm*.pgm), see note below.
  • crop - Optional box to limit geoid locations, a 4-tuple (south, west, north, east), 2-tuple ((south, west), (north, east)) with 2 degrees90 lat- and degrees180 longitudes or as 2-tuple (LatLonSW, LatLonNE) of LatLon instances.
  • datum - Optional grid datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple), default WGS84.
  • kind - Interpolation order (int), 2 for bilinear or 3 for cubic.
  • name_smooth - Optional geoid name=NN (str) and UNSUPPORTED keyword argument smooth, use smooth=None to ignore.
Raises:
  • GeoidError - EGM dataset egm_pgm issue or invalid crop, kind or smooth.
  • TypeError - Invalid datum.
Overrides: object.__init__

See Also: Class GeoidPGM and function egmGeoidHeights.

Note: Geoid file egm_pgm remains open and must be closed by calling method close or by using with GeoidKarney(...) as ...: context.

__call__ (self, *llis, **wrap_H)
(Call operator)

 

Interpolate the geoid height for one or several locations.

Arguments:
  • llis - One or more locations (LatLons), all positional.
  • wrap_H - Keyword arguments wrap=False, H=False. If wrap is True, wrap or normalize all llis locations (bool). If H is True, return the orthometric height instead of the geoid height at each location (bool).
Returns:
A single interpolated geoid (or orthometric) height (float) or a list or tuple of interpolated geoid (or orthometric) heights (floats).
Raises:
  • GeoidError - Insufficient number of llis, an invalid lli or the egm*.pgm geoid file is closed.
  • RangeError - An lli is outside this geoid's lat- or longitude range.
Overrides: heights._HeightBase.__call__

Note: To obtain orthometric heights, each llis location must have an ellipsoid height or h attribute, otherwise height=0 is used.

See Also: Function pygeodesy.heightOrthometric.

height (self, lats, lons, **wrap)

 

Interpolate the geoid height for one or several lat-/longitudes.

Arguments:
  • lats - Latitude or latitudes (degrees or degreess).
  • lons - Longitude or longitudes (degrees or degreess).
  • wrap - If True, wrap or normalize all lats and lons locations (bool).
Returns:
A single interpolated geoid height (float) or a list of interpolated geoid heights (floats).
Raises:
  • GeoidError - Insufficient or non-matching number of lats and lons or the egm*.pgm geoid file is closed.
  • RangeError - A lat or lon is outside this geoid's lat- or longitude range.
Overrides: heights._HeightBase.height

highest (self, LatLon=None, full=False)

 

Return the location and largest height of this geoid.

Arguments:
  • LatLon - Optional class to return the location and height (LatLon) or None.
  • full - Search the full or limited latitude range (bool).
Returns:
If LatLon is None, a LatLon3Tuple(lat, lon, height) otherwise a LatLon instance with the lat-, longitude and geoid height of the highest grid location.
Overrides: _GeoidBase.highest

lowest (self, LatLon=None, full=False)

 

Return the location and lowest height of this geoid.

Arguments:
  • LatLon - Optional class to return the location and height (LatLon) or None.
  • full - Search the full or limited latitude range (bool).
Returns:
If LatLon is None, a LatLon3Tuple(lat, lon, height) otherwise a LatLon instance with the lat-, longitude and geoid height of the lowest grid location.
Overrides: _GeoidBase.lowest

Property Details

dtype

Get method:
_fget(inst) - Get and cache/memoize the property value.
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.