I am using the python SGP4 1.1 module to calculate the position and velocity of a MEO satellite. I'm noticing when compared against STK and JSatTrak that the returned values for position and velocity are incorrect. The Satellite should have a ground repeat track of roughly 6 hours, but this program is showing a ground repeat of 4:47:51. Is there something that I am doing incorrectly?
from sgp4.earth_gravity import wgs72
from sgp4.io import twoline2rv
from math import atan2, cos, pi, sin, sqrt, tan
from datetime import datetime
def calculate(options):
x = options[0]
y = options[1]
z = options[2]
# Constants (WGS ellipsoid)
a = 6378.137
e = 8.1819190842622e-2
# Calculation
b = sqrt(pow(a,2) * (1-pow(e,2)))
ep = sqrt((pow(a,2)-pow(b,2))/pow(b,2))
p = sqrt(pow(x,2)+pow(y,2))
th = atan2(a*z, b*p)
lon = atan2(y, x)
lat = atan2((z+ep*ep*b*pow(sin(th),3)), (p-e*e*a*pow(cos(th),3)))
n = a/sqrt(1-e*e*pow(sin(lat),2))
alt = str(p/cos(lat)-n)
lat = str((lat*180)/pi)
lon = str((lon*180)/pi)
#print "%s %s %s" % (lat, lon, alt)
return (lat, lon, alt)
line1 = '1 1U 001001 14001.00000000 .00000000 00000+0 00000+0 0 00022'
line2 = '2 1 0.0891 294.8098 0002843 64.8653 0.5014 5.00115502 09'
satellite = twoline2rv(line1, line2, wgs72)
position1, velocity1 = satellite.propagate(2013, 3, 1, 0, 0, 1)
position2, velocity2 = satellite.propagate(2013, 3, 1, 4, 47, 52)
lat1,lon1,alt1 = calculate(position1)
lat2,lon2,alt2 = calculate(position2)
print lat1 + " " + lon1 + " " + alt1
print lat2 + " " + lon2 + " " + alt2
print "\n\n"
print position1
print position2
Simplified Deep Space Perturbations (SDP) models apply to objects with an orbital period greater than 225 minutes, which corresponds to an altitude of 5,877.5 km, assuming a circular orbit. As a result, you have to use SDP4 or SDP8 for MEO satellites.