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

# Class GeoidG2012B

         object --+
                  |
       named._Named --+
                      |
    heights._HeightBase --+
                          |
       heights._HeightsBase --+
                              |
                     _GeoidBase --+
                                  |
                                 GeoidG2012B

Geoid height interpolator for GEOID12B Model grids CONUS, Alaska, Hawaii, Guam and Northern Mariana Islands, Puerto Rico and U.S. Virgin Islands and American Samoa based on `SciPy` RectBivariateSpline or interp2d interpolation.

Use any of the binary `le` (little endian) or `be` (big endian) `g2012b*.bin` grid files.

Instance Methods
__init__(self, g2012b_bin, crop=None, datum=None, kind=3, name='', smooth=0) New GeoidG2012B 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. |
Inherited from `_GeoidBase`: `__enter__`, `__exit__`, `__repr__`, `__str__`, `center`, `close`, `highest`, `loweright`, `lowerleft`, `lowerright`, `lowest`, `outside`, `toStr`, `upperleft`, `upperright` Inherited from `named._Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `dup`, `methodname`, `rename`, `toRepr`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
Inherited from `_GeoidBase`: `closed`, `cropped`, `dtype`, `endian`, `hits`, `kind`, `knots`, `mean`, `nBytes`, `name`, `pgm`, `sizeB`, `smooth`, `stdev`, `u2B` Inherited from `heights._HeightsBase`: `numpy`, `scipy`, `scipy_interpolate` Inherited from `heights._HeightBase`: `datum`, `kmin`, `wrap` Inherited from `named._Named`: `classname`, `classnaming`, `iteration`, `named`, `named2`, `named3`, `named4`, `sizeof` Inherited from `object`: `__class__`

Method Details

### __init__ (self, g2012b_bin, crop=None, datum=None, kind=3, name='', smooth=0) (Constructor) |
New GeoidG2012B interpolator. Arguments: `g2012b_bin` - A `GEOID12B` grid file name (`.bin`). `crop` - Optional crop box, not supported (`None`). `datum` - Optional grid datum (Datum, Ellipsoid, Ellipsoid2 or a_f2Tuple), default `WGS84`. `kind` - `scipy.interpolate` order (`int`), use 1..5 for RectBivariateSpline, -2 for interp2d linear, -3 for `interp2d cubic` or -5 for `interp2d quintic`. `name` - Optional geoid name (`str`). `smooth` - Smoothing factor for RectBivariateSpline only (`int`). Raises: `GeoidError` - G2012B grid file `g2012b_bin` issue or invalid `crop`, `kind` or `smooth`. `ImportError` - Package `numpy` or `scipy` not found or not installed. `LenError` - Grid file `g2012b_bin` axis mismatch. `SciPyError` - A `RectBivariateSpline` or `inter2d` issue. `SciPyWarning` - A `RectBivariateSpline` or `inter2d` warning as exception. `TypeError` - Invalid `datum`. Overrides: object.__init__ Note: `scipy.interpolate.interp2d` has been `DEPRECATED`, specify `kind=1..5` for `scipy.interpolate.RectBivariateSpline`.

### __call__ (self, *llis, **wrap_H) (Call operator) |
Interpolate the geoid height for one or several locations. Arguments: `llis` - One or more locations (`LatLon`s), 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 (`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. `SciPyError` - A `scipy.interpolate.inter2d` or `-.RectBivariateSpline` issue. `SciPyWarning` - A `scipy.interpolate.inter2d` or `-.RectBivariateSpline` warning as exception. Overrides: heights._HeightsBase.__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 `degrees`s). `lons` - Longitude or longitudes (`degrees` or `degrees`s). `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 (`float`s). Raises: `GeoidError` - Insufficient or non-matching number of `lats` and `lons`. `RangeError` - A `lat` or `lon` is outside this geoid's lat- or longitude range. `SciPyError` - A `scipy.interpolate.inter2d` or `-.RectBivariateSpline` issue. `SciPyWarning` - A `scipy.interpolate.inter2d` or `-.RectBivariateSpline` warning as exception. Overrides: heights._HeightsBase.height