计算太阳/国际空间站与地球观测者之间的相角 [英] Calculating the Phase Angle between the Sun / ISS and an observer on the earth
问题描述
为帮助我计算国际空间站的视觉震级,我需要能够计算相位角.
To help me with calculating the visual magnitude of the International Space Station I need to be able to calculate the phase angle.
有人可以帮我计算一下吗?
Can anyone help me calculate that?
在任何时候,我都使用PyEphem
生成了Obs
对象和ISS
对象.对于观察者,我有Alt/Az
到ISS
,并且有Alt/Az
到太阳……当然,我有ISS.range
(以千米为单位).因此,在我看来,我应该能够以简单"的几何形状计算出相角.不幸的是,这种简单的几何形状超出了我能够自信地完成的工作(自从我上次这样做以来,我猜想已经太久了.)
For any moment in time I have generated the Obs
object and the ISS
object using PyEphem
. For the observer I have the Alt/Az
to the ISS
and Alt/Az
to the Sun... And of course I have the ISS.range
(in km) from the observer. So it looks to me that I should be able to calculate the phase angle with "simple" geometry. Unfortunately, this simple geometry is a little beyond what I am capable of confidently working out (been too long I guess since I last did that).
答案:我想出来了(在良好的旧互联网的帮助下) 这是部分代码段(由Leandro Guedes对ephem.earth_radius进行更正,更新为Km)
ANSWER: I figured it out (with the help of the good old Internets) This is a partial code snippet (updated with correction for ephem.earth_radius to Km by Leandro Guedes)
# 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!!
推荐答案
由于angle_b
几乎为零(在近日点和ISS直接在头顶处最大0.00016度),因此您只需执行angle_a = math.pi - angle_c
.
Since angle_b
is practically zero (max 0.00016 degrees at perihelion and ISS directly overhead), you could just do angle_a = math.pi - angle_c
.
这具有几乎相同的精度,因为您已经在距离a
上犯了一些小错误.
This has about the same accuracy, since you already have made some minor errors with distance a
.
这篇关于计算太阳/国际空间站与地球观测者之间的相角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!