I am trying to track the satellite and getting its location in form of latitude, longitude and height from TLE data. But when I try to match it with the realtime readings on n2yo website, my latitude has difference of 5 degree and longitude difference of 12 degree on average. Height is exactly same
I am using the skyfield library to calculate location. Here is the code that I am using.
def get_live_data(TLE):
load = Loader('~/Documents/fishing/SkyData')
data = load('de421.bsp')
ts = load.timescale()
planets = load('de421.bsp')
earth = planets['earth']
ts = load.timescale()
minutes = np.arange(0, 240, 2)
L1, L2 = TLE.splitlines()
CARTO_Geo = EarthSatellite(L1, L2)
time = ts.now()
geocentric = CARTO_Geo.at(time)
lat, lon = wgs84.latlon_of(geocentric)
h = wgs84.height_of(geocentric)
time_str = f"{time.utc.hour}: {time.utc.minute}: {int(time.utc.second)}"
position = {'lat': round(lat.degrees, 2), 'lon': round(lon.degrees, 2), 'height': round(h.km, 2), 'time': time_str}
return position
The "Epoch Date" of satellite TLE is 15-July-2023
TLE :
1 44804U 19081A 23196.35840878 .00005378 00000+0 25694-3 0 9994
2 44804 97.3450 253.5493 0009838 278.3489 81.6631 15.19397374201298