Are there any libraries in Python that have functions that compute for geoid heights using egm84, egm96 and egm2008?
I know that geographiclib has a function (http://geographiclib.sourceforge.net/html/classGeographicLib_1_1GravityModel.html) that computes for geoid heights using the three egms but I don't know how to implement them in Python (if they are really applicable). How do you implement that? Or if it isn't applicable to Python, are there any libraries that can be used?
Thank you.
There is some relevant work done here on this:
https://github.com/mrJean1/PyGeodesy
Their instructions on use were not the most up to date, but here is a TLDR:
First download your choice of geoid from here, like so:
wget https://sourceforge.net/projects/geographiclib/files/geoids-distrib/egm2008-5.tar.bz2
bzip2 -d egm2008-5.tar.bz2
tar -xvf egm2008-5.tar
Then use in your python script:
import pygeodesy
from pygeodesy.ellipsoidalKarney import LatLon
ginterpolator = pygeodesy.GeoidKarney("./geoids/egm2008-5.pgm")
# Make an example location
lat=51.416422
lon=-116.217151
# Get the geoid height
single_position=LatLon(lat, lon)
h = ginterpolator(single_position)
print(h)
This will give you the deviation from the ellipsoid at that location in meters:
-11.973145778529625
This roughly matches up with what we find when we use an online calculator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With