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

# Class GeoidKarney

         object --+
                  |
       named._Named --+
                      |
    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=None) New GeoidKarney interpolator. |
__call__(self, *llis) Interpolate the geoid height for one or several locations. |
height(self, lats, lons) 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`: `_DOT_`, `attrs`, `classof`, `copy`, `rename`, `toRepr`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| dtype Get the geoid's grid data type (`str`).
| u2B Get the PGM itemsize in bytes (`int`).
Inherited from `_GeoidBase`: `closed`, `cropped`, `endian`, `hits`, `kind`, `knots`, `mean`, `nBytes`, `name`, `numpy`, `pgm`, `scipy`, `sizeB`, `smooth`, `stdev` Inherited from `heights._HeightBase`: `adjust`, `datum`, `kmin`, `wrap` Inherited from `named._Named`: `classname`, `classnaming`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __init__ (self, egm_pgm, crop=None, datum=None, kind=3, name='', smooth=None) (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)`) or 2, in `degrees90` lat- and `degrees180` longitudes or a 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` - Optional geoid name (`str`). `smooth` - Smoothing factor, unsupported (`None`). 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 the `close` method or by using this instance in a `with GeoidKarney(...) as ...` context.

### __call__ (self, *llis) (Call operator) |
Interpolate the geoid height for one or several locations. Arguments: `llis` - The location or locations (`LatLon`, ... or `LatLon`s). Returns: A single interpolated geoid height (`float`) or a list or tuple of interpolated geoid heights (`float`s). 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__

### height (self, lats, lons) |
Interpolate the geoid height for one or several lat-/longitudes. Arguments: `lats` - Latitude or latitudes (`degrees` or `degrees`s). `lons` - Longitude or longitudes (`degrees` or `degrees`s). Returns: A single interpolated geoid height (`float`) or a list of interpolated geoid heights (`float`s). 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: _GeoidBase.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 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 height of the lowest grid location. Overrides: _GeoidBase.lowest

Property Details

### dtype Get the geoid's grid data type (`str`). Get method: dtype(self) - Get the geoid's grid data type (`str`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### u2B Get the PGM itemsize in bytes (`int`). Get method: u2B(self) - Get the PGM itemsize in bytes (`int`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.