我正在使用 python SGP4 1.1 模块来计算 MEO 卫星的位置和速度。当与 STK 和 JSatTrak 进行比较时,我注意到返回的位置和速度值不正确。卫星应该有大约 6 小时的地面重复轨道,但这个程序显示的是 4:47:51 的地面重复。有什么我做错了吗?
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