PyEphem的3.7.5.3版(2014年5月29日)的变更日志提到,所有主体都被赋予了.parallactic_angle()方法,但在quick references或教程中找不到它。它需要什么参数?

最佳答案

# Compute parallactic angle using PyEphem.
city = ephem.city( ... )
moon = ephem.moon( city )
parallacticAngle = moon.parallactic_angle()


下面的代码从indicator-lunar中剥离并计算视差角,用于进一步计算亮肢。

# Compute the bright limb angle (relative to zenith) between the sun moon.
# Measured in degrees counter clockwise from a positive y axis.
# 'Astronomical Algorithms' Second Edition by Jean Meeus (chapters 14 and 48).
# 'Practical Astronomy with Your Calculator' by Peter Duffett-Smith (chapters 59 and 68).
city = ephem.city( ... )
moon = ephem.moon( city )
sun = ephem.Sun( city )

y = math.cos( sun.dec ) * math.sin( sun.ra - moon.ra )
x = math.cos( moon.dec ) * math.sin( sun.dec ) - math.sin( body.dec ) * math.cos( sun.dec ) * math.cos( sun.ra - moon.ra ) positionAngleOfBrightLimb = math.atan2( y, x )

hourAngle = city.sidereal_time() - moon.ra
y = math.sin( hourAngle )
x = math.tan( city.lat ) * math.cos( moon.dec ) - math.sin( moon.dec ) * math.cos( hourAngle )
parallacticAngle = math.atan2( y, x )
brightLimbAngle = math.degrees( ( positionAngleOfBrightLimb - parallacticAngle ) % ( 2.0 * math.pi ) )


将我的计算值与PyEphem的计算值进行比较,它们都匹配(一个是浮点弧度,另一个是十进制度数)。

关于python - PyEphem中的.parallactic_angle()方法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31109366/

10-13 22:37