.parallactic_angle() PyEphem 中的方法

.parallactic_angle() method in PyEphem

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 的计算值进行比较,它们都匹配(一个是浮点弧度,另一个打印为十进制)。