3. Using pyegt

pyegt is designed to be easy to use. Simply initialize a pyegt.height.HeightModel object to perform a datum lookup. The following example uses the NOAA NGS API for Geoid to perform a lookup against GEOID12B.

>>> from pyegt.height import HeightModel
>>> h = HeightModel(lat=44.256616, lon=-73.964784, from_model='GEOID12B')
>>> h
HeightModel(lat=44.256616, lon=-73.964784, from_model='GEOID12B', region='None') -> -28.157 meters
>>> float(h)
-28.157
>>> h.in_feet_us_survey()
-92.37842416572809

pyegt can also be used to query the VDatum API.

>>> from pyegt.height import HeightModel
>>> h = HeightModel(lat=44.256616, lon=-73.964784, from_model='EGM2008', region='contiguous')
>>> h
HeightModel(model='EGM2008', lat=44.256616, lon=-73.964784, region='contiguous') -> -28.899 meters

Note

The region argument must be supplied for VDatum queries. If it is not supplied by the user, it will default to "contiguous".

Note

VDatum and NGS geoid APIs are highly functional API software. pyegt is a wrapper that does not utilize all of their functionality. Its sole function is to perform lookups of ellipsoid height at specific locations on geoid and tidal models.