首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >.parallactic_angle()方法( PyEphem )

.parallactic_angle()方法( PyEphem )
EN

Stack Overflow用户
提问于 2015-06-29 06:46:33
回答 1查看 504关注 0票数 1

PyEphem的3.7.5.3版本(2014年5月29日)的Changelog提到,所有的主体都得到了一个.parallactic_angle()方法,但我在快速参考或教程中找不到它。它需要什么论据?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-14 11:49:52

代码语言:javascript
复制
# Compute parallactic angle using PyEphem.
city = ephem.city( ... )
moon = ephem.moon( city )
parallacticAngle = moon.parallactic_angle()

下面的代码是从指示器-月球中提取的,并计算平行角度,用于进一步计算明亮的肢体角度。

代码语言:javascript
复制
# 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的值,它们都匹配(一个是浮点数,另一个打印为十进制)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31109366

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档