给定RA/D的pyephem FixedObject()

2024-06-16 12:57:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我在寻找确定(不著名的)恒星在给定的RA/Dec在毛纳克亚的特定时间的alt/az。我试图用pyephem来计算这些参数,但是得到的alt/az与其他来源不一致。以下是Keck对HAT-P-32的计算:

import ephem
telescope = ephem.Observer()
telescope.lat =  '19.8210'
telescope.long = '-155.4683'
telescope.elevation = 4154
telescope.date = '2013/1/18 10:04:14'
star = ephem.FixedBody()
star._ra = ephem.degrees('02:04:10.278')
star._dec = ephem.degrees('+46:41:16.21')
star.compute(telescope)
print star.alt, star.az

它返回-28:43:54.0 73:22:55.3,但是根据Stellarium,正确的alt/az应该是:62:26:03 349:15:13。我做错什么了?在

编辑:修正了先前颠倒的纬度和经度。在


Tags: 参数hat时间来源altdecazstar
2条回答

首先,需要向后设置long和latitude;其次,需要以十六进制形式提供字符串;第三,需要以小时(而不是度数)的形式提供RA:

import ephem
telescope = ephem.Observer()
# Reversed longitude and latitude for Mauna Kea
telescope.lat =    '19:49:28' # from Wikipedia
telescope.long = '-155:28:24'
telescope.elevation = 4154.
telescope.date = '2013/1/18 00:04:14'
star = ephem.FixedBody()
star._ra  = ephem.hours('02:04:10.278') # in hours for RA
star._dec = ephem.degrees('+46:41:16.21')
star.compute(telescope)

这样,您可以得到:

^{pr2}$

PyEphem总是使用UTC表示时间,这样程序无论在何处运行,都会执行相同的操作并给出相同的输出。您只需将使用的日期转换为UTC,而不是使用本地时区,结果与Stellarium非常一致;请使用:

telescope.date = '2013/1/18 05:04:14'

结果是alt/az:

^{pr2}$

为了知道剩余的小差异是从哪里来的,我必须研究这两个程序是如何处理它们计算的每一步的;但是这是否足够接近?在

相关问题 更多 >