skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.4k stars 211 forks source link

wgs84.height_of not working #665

Closed troyrock closed 2 years ago

troyrock commented 2 years ago

from skyfield.api import load, EarthSatellite, wgs84

self.SGP4_sat = EarthSatellite(TLE[0], TLE[1]) start_time = ts.from_datetime(self.SGP4_sat.epoch.utc_datetime()) self.geocentric = self.SGP4_sat.at(start_time) self.latitude, self.longitude, self.elevation = self.geocentric.frame_latlon(itrs) self.altitude = wgs84.height_of(self.geocentric)

I am getting the error: --> 321 self.altitude = wgs84.height_of(self.geocentric)

AttributeError: 'Geoid' object has no attribute 'height_of'

troyrock commented 2 years ago

geocentric.frame_latlon returns elevation

brandon-rhodes commented 2 years ago

What version of Skyfield do you have installed? Is it possible that it's an old enough version that the new height_of feature is missing? You'll need 1.40.