Calculating the Phase Angle between the Sun / ISS

2020-03-24 05:26发布

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?

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).

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!!

标签: pyephem
2条回答
▲ chillily
2楼-- · 2020-03-24 05:44

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.

This has about the same accuracy, since you already have made some minor errors with distance a.

查看更多
劫难
3楼-- · 2020-03-24 05:45

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!!

(Formally posting my answer AS an ACTUAL answer - yes - it took me a while to figure out that's what I should have done all along).

查看更多
登录 后发表回答