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

# Class GeoidPGM

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

Geoid height interpolator for Charles Karney's GeographicLib Earth Gravitational Model (EGM) geoid egm*.pgm datasets but based on `SciPy` RectBivariateSpline or interp2d interpolation.

Use any of the egm84-, egm96- or egm2008-*.pgm datasets. However, unless cropped, an entire `egm*.pgm` dataset is loaded into the `SciPy` RectBivariateSpline or interp2d interpolator and converted from 2-byte `int` to 8-byte `dtype float64`. Therefore, internal memory usage is 4x the egm*.pgm file size and may exceed the available memory, especially with 32-bit Python, see properties `.nBytes` and `.sizeB`.

Instance Methods
__init__(self, egm_pgm, crop=None, datum=None, kind=3, name=`'````'`, smooth=0) New GeoidPGM interpolator. |
Inherited from `_GeoidBase`: `__call__`, `__repr__`, `__str__`, `center`, `height`, `highest`, `lowerleft`, `lowerright`, `lowest`, `outside`, `toStr`, `upperleft`, `upperright` Inherited from `named._Named`: `classof`, `copy`, `toStr2` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| pgm Get the PGM attributes (`_PGM`).
| u2B Get the PGM itemsize in bytes (`int`).
Inherited from `_GeoidBase`: `cropped`, `dtype`, `endian`, `hits`, `kind`, `knots`, `mean`, `nBytes`, `name`, `numpy`, `scipy`, `sizeB`, `smooth`, `stdev` Inherited from `named._Named`: `classname`, `classnaming`, `named`, `named2` Inherited from `object`: `__class__`

Method Details

### __init__(self, egm_pgm, crop=None, datum=None, kind=3, name=`'````'`, smooth=0) (Constructor) |
New GeoidPGM interpolator. Parameters: `egm_pgm` - An EGM geoid dataset file name (`egm*.pgm`). `crop` - Optional box to crop `egm_pgm`, a 4-tuple (`south, west, north, east`) or 2-tuple (`(south, west), (north, east)`), in `degrees90` lat- and `degrees180` longitudes or a 2-tuple (`LatLonSW, LatLonNE`) of `LatLon` instances. `datum` - Optional grid datum (`Datum`), 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` - EGM dataset `egm_pgm` issue or invalid `crop`, `kind` or `smooth`. `ImportError` - Package `numpy` or `scipy` not found or not installed. `SciPyError` - A `RectBivariateSpline` or `inter2d` issue. `SciPyWarning` - A `RectBivariateSpline` or `inter2d` warning as exception. Overrides: object.__init__ Note: The GeographicLib egm*.pgm file sizes are based on a 2-byte `int` height converted to 8-byte `dtype float64` for `scipy` interpolators. Therefore, internal memory usage is 4 times the `egm*.pgm` file size and may exceed the available memory, especially with 32-bit Python. To reduce memory usage, set keyword argument `crop` to the region of interest. For example crop=(20, -125, 50, -65) covers the conterminous US (CONUS), less than 3% of the entire `egm2008-1.pgm` dataset. See Also: Class GeoidKarney and function egmGeoidHeights.

Property Details

### pgm Get the PGM attributes (`_PGM`). Get Method: pgm(self) - Get the PGM attributes (`_PGM`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### u2B Get the PGM itemsize in bytes (`int`). Get Method: u2B(self) - Get the PGM itemsize in bytes (`int`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.