为了帮助我计算国际空间站的视觉大小,我需要能够计算相位角。
任何人都可以帮我计算一下吗?
我在任何时候都使用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!!
答案 0 :(得分:0)
答案:我想出来了(在良好的旧互联网的帮助下) 这是部分代码段(由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!!
(将我的答案作为一个实际答案正式发布-是的-我花了一段时间才弄清楚那是我一直应该做的事情)。
答案 1 :(得分:0)
由于angle_b
几乎为零(近日点和ISS直接在头顶时最大0.00016度),因此您可以执行angle_a = math.pi - angle_c
。
由于您已经在距离a
上犯了一些小错误,因此精度几乎相同。