Quantcast
Channel: Active questions tagged propagation - Stack Overflow
Viewing all articles
Browse latest Browse all 52

Python SGP4 1.1 Calculating Incorrect Orbit

$
0
0

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 wgs72from sgp4.io import twoline2rvfrom math import atan2, cos, pi, sin, sqrt, tanfrom datetime import datetimedef 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  +""+ alt1print lat2 +""+ lon2  +""+ alt2print "\n\n"print position1print position2   

Viewing all articles
Browse latest Browse all 52

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>