为了帮助我计算国际空间站的视觉大小,我需要能够计算相位角。
谁能帮我计算一下?
在任何时候,我Obs
都ISS
使用PyEphem
. 对于观察者,我有到Alt/Az
太阳的距离......当然,我有来自观察者的(以公里为单位)。所以在我看来,我应该能够用“简单”的几何形状计算相位角。不幸的是,这个简单的几何形状有点超出我能够自信地解决的能力(我想自从我上次这样做以来已经太久了)。ISS
Alt/Az
ISS.range
答案:我想通了(在旧互联网的帮助下)这是一个部分代码片段(Leandro Guedes 更新了 ephem.earth_radius 到 Km 的更正)
# SSA Triangle. We have side a and b and angle C. Need to solve to find side c
a = sun.earth_distance * au - ephem.earth_radius/1000 #distance sun from observer (Km)
b = iss.range / 1000 # distance to ISS from observer (Km)
angle_c = ephem.separation( (iss.az, iss.alt), ( sun.az, sun.alt) )
c = math.sqrt( math.pow(a,2) + math.pow(b,2) - 2*a*b*math.cos( angle_c) )
# now we find the "missing" angles (of which angle A is the one we need)
angle_a = math.acos((math.pow(b,2) + math.pow( c,2) - math.pow(a,2)) / (2 * b * c))
angle_b = math.pi - angle_a - angle_c #note: this is basically ZERO - not a big surprise really - and I don't need this anyway.
phase_angle = angle_a # This is the angle we need. BINGO!!