gpt4 book ai didi

pyephem - 计算太阳/国际空间站与地球上的观察者之间的相位角

转载 作者:行者123 更新时间:2023-12-02 05:05:47 32 4
gpt4 key购买 nike

为了帮助我计算国际空间站的视觉星等,我需要能够计算相位角。

谁能帮我算一下吗?

在任何时刻我都会生成 Obs对象和ISS对象使用 PyEphem 。对于观察者我有 Alt/AzISSAlt/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!!

最佳答案

答案:我想通了(在古老的互联网的帮助下)这是部分代码片段(由 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!!

(正式将我的答案作为实际答案发布 - 是的 - 我花了一段时间才弄清楚这就是我应该一直做的事情)。

关于pyephem - 计算太阳/国际空间站与地球上的观察者之间的相位角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19759501/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com