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

# Class _GeoidBase

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

Known Subclasses:
  - GeoidEGM96
  - , GeoidG2012B
  - , GeoidKarney
  - , GeoidPGM

(INTERNAL) Base class for `Geoid...`s.

Instance Methods
__init__(self, hs, p) (INTERNAL) Set up the grid axes, the `SciPy` interpolator and several internal geoid attributes. |
__call__(self, *llis, **wrap_H) Interpolate the geoid (or orthometric) height for one or more locations. |
__enter__(self) Open context. |
__exit__(self, *unused) Close context. |
__repr__(self) Default `repr(self)`. |
__str__(self) Default `str(self)`. |
center(self, LatLon=None) Return the center location and height of this geoid. |
close(self) Close the `egm*.pgm` geoid file if open (and applicable). |
height(self, lats, lons, **wrap) Interpolate the geoid height for one or several lat-/longitudes. |
height_(self, *latlons, **wrap) Interpolate the geoid height for each (latlons[i], latlons[i+1]) pair for i in range(0, len(latlons), 2). |
highest(self, LatLon=None, **unused) Return the location and largest height of this geoid. |
lowerleft(self, LatLon=None) Return the lower-left location and height of this geoid. |
loweright(self, LatLon=None) Return the lower-right location and height of this geoid. |
lowerright(self, LatLon=None) Return the lower-right location and height of this geoid. |
lowest(self, LatLon=None, **unused) Return the location and lowest height of this geoid. |
outside(self, lat, lon) Check whether a location is outside this geoid's lat-/longitude or crop range. |
toStr(self, prec=3, sep=', ') This geoid and all geoid attributes as a string. |
upperleft(self, LatLon=None) Return the upper-left location and height of this geoid. |
upperright(self, LatLon=None) Return the upper-right location and height of this geoid. |
Inherited from `named._Named`: `__format__`, `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `renamed`, `toRepr`, `toStr2` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| closed Get the `egm*.pgm` geoid file status.
| cropped Is geoid cropped (`bool` or `None` if crop not supported).
| dtype Get the grid `scipy` dtype (`numpy.dtype`).
| endian Get the geoid endianess and dtype (`str`).
| hits Get the number of cache hits (`int` or `None`).
| kind Get the interpolator kind and order (`int`).
| knots Get the number of grid knots (`int`).
| mean Get the mean of this geoid's heights (`float`).
| name Get the name of this geoid (`str`).
| nBytes Get the grid in-memory size in bytes (`int`).
| pgm Get the PGM attributes (`_PGM` or `None` if not available/applicable).
| sizeB Get the geoid grid file size in bytes (`int`).
| smooth Get the `RectBivariateSpline` smoothing (`int`).
| stdev Get the standard deviation of this geoid's heights (`float`) or `None`.
| u2B Get the PGM itemsize in bytes (`int`).
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`, `typename` Inherited from `object`: `__class__`

Method Details

### __init__ (self, hs, p) (Constructor) |
(INTERNAL) Set up the grid axes, the `SciPy` interpolator and several internal geoid attributes. Arguments: `hs` - Grid knots with known height (`numpy 2darray`). `p` - The `slat, wlon, nlat, nlon, dlat, dlon` and other geoid parameters (`INTERNAL`). Overrides: object.__init__

### __call__ (self, *llis, **wrap_H) (Call operator) |
Interpolate the geoid (or orthometric) height for one or more locations. Arguments: `llis` - One or several locations (each `LatLon`), all positional. `wrap_H` - Keyword arguments `wrap=False` (`bool`) and `H=False` (`bool`). Use `wrap=True` to wrap or normalize all `llis` locations. If `H is True`, return the orthometric height instead of the geoid height at each location. Returns: A single geoid (or orthometric) height (`float`) or a list or tuple of geoid (or orthometric) heights (each `float`). 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. `SciPyError` - A `scipy` issue. `SciPyWarning` - A `scipy` warning as exception. Overrides: heights._HeightNamed.__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.

### __repr__ (self) (Representation operator) |
Default `repr(self)`. Overrides: object.__repr__ (inherited documentation)

### __str__ (self) (Informal representation operator) |
Default `str(self)`. Overrides: object.__str__ (inherited documentation)

### center (self, LatLon=None) |
Return the center location and height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. Returns: If `LatLon is None`, a LatLon3Tuple`(lat, lon, height)` otherwise a `LatLon` instance with the lat-, longitude and geoid height of the center grid location.

### height (self, lats, lons, **wrap) |
Interpolate the geoid height for one or several lat-/longitudes. Arguments: `lats` - Latitude or latitudes (each `degrees`). `lons` - Longitude or longitudes (each `degrees`). `wrap` - Use `wrap=True` to wrap or normalize all `lats` and `lons`. Returns: A single geoid height (`float`) or a list of geoid heights (each `float`). Raises: `GeoidError` - Insufficient or unequal number of `lats` and `lons`. `RangeError` - A `lat` or `lon` is outside this geoid's lat- or longitude range. `SciPyError` - A `scipy` issue. `SciPyWarning` - A `scipy` warning as exception. Overrides: heights._HeightNamed.height

### height_ (self, *latlons, **wrap) |
Interpolate the geoid height for each (latlons[i], latlons[i+1]) pair for i in range(0, len(latlons), 2). Arguments: `latlons` - Alternating lat-/longitude pairs (each `degrees`), all positional. Returns: A tuple of geoid heights (each `float`). Overrides: heights._HeightNamed.height_ See Also: Method height for further details.

### highest (self, LatLon=None, **unused) |
Return the location and largest height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. 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.

### lowerleft (self, LatLon=None) |
Return the lower-left location and height of this geoid. Arguments: `LatLon` - Optional class to return the location (`LatLon`) and height or `None`. Returns: If `LatLon is None`, a LatLon3Tuple`(lat, lon, height)` otherwise a `LatLon` instance with the lat-, longitude and geoid height of the lower-left, SW grid corner.

### loweright (self, LatLon=None) |
Return the lower-right location and height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. Returns: If `LatLon is None`, a LatLon3Tuple`(lat, lon, height)` otherwise a `LatLon` instance with the lat-, longitude and geoid height of the lower-right, SE grid corner.

### lowerright (self, LatLon=None) |
Return the lower-right location and height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. Returns: If `LatLon is None`, a LatLon3Tuple`(lat, lon, height)` otherwise a `LatLon` instance with the lat-, longitude and geoid height of the lower-right, SE grid corner.

### lowest (self, LatLon=None, **unused) |
Return the location and lowest height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. 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.

### outside (self, lat, lon) |
Check whether a location is outside this geoid's lat-/longitude or crop range. Arguments: `lat` - The latitude (`degrees`). `lon` - The longitude (`degrees`). Returns: A 1- or 2-character `str` if outside, an empty `str` otherwise.

### toStr (self, prec=3, sep=', ') |
This geoid and all geoid attributes as a string. Arguments: `prec` - Number of decimal digits (0..9 or `None` for default). Trailing zero decimals are stripped for `prec` values of 1 and above, but kept for negative `prec` values. `sep` - Separator to join (`str`). Returns: Geoid name and attributes (`str`). Overrides: named._Named.toStr

### upperleft (self, LatLon=None) |
Return the upper-left location and height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. Returns: If `LatLon is None`, a LatLon3Tuple`(lat, lon, height)` otherwise a `LatLon` instance with the lat-, longitude and geoid height of the upper-left, NW grid corner.

### upperright (self, LatLon=None) |
Return the upper-right location and height of this geoid. Arguments: `LatLon` - Optional class to return the location and height (`LatLon`) or `None`. Returns: If `LatLon is None`, a LatLon3Tuple`(lat, lon, height)` otherwise a `LatLon` instance with the lat-, longitude and geoid height of the upper-right, NE grid corner.

Property Details

### closed Get the `egm*.pgm` geoid file status. Get method: closed(self) - Get the `egm*.pgm` geoid file status. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### cropped Is geoid cropped (`bool` or `None` if crop not supported). Get method: cropped(self) - Is geoid cropped (`bool` or `None` if crop not supported). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### dtype Get the grid `scipy` dtype (`numpy.dtype`). Get method: dtype(self) - Get the grid `scipy` dtype (`numpy.dtype`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

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

### hits Get the number of cache hits (`int` or `None`). Get method: hits(self) - Get the number of cache hits (`int` or `None`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### kind Get the interpolator kind and order (`int`). Get method: kind(self) - Get the interpolator kind and order (`int`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### knots Get the number of grid knots (`int`). Get method: knots(self) - Get the number of grid knots (`int`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### mean Get the mean of this geoid's heights (`float`). Get method: mean(self) - Get the mean of this geoid's heights (`float`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### name Get the name of this geoid (`str`). Get method: name(self) - Get the name of this geoid (`str`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

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

### pgm Get the PGM attributes (`_PGM` or `None` if not available/applicable). Get method: pgm(self) - Get the PGM attributes (`_PGM` or `None` if not available/applicable). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

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

### smooth Get the `RectBivariateSpline` smoothing (`int`). Get method: smooth(self) - Get the `RectBivariateSpline` smoothing (`int`). Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.

### stdev Get the standard deviation of this geoid's heights (`float`) or `None`. Get method: stdev(self) - Get the standard deviation of this geoid's heights (`float`) or `None`. 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.