有没有办法使用PyEphem计算目标列表的上升/设定值?我的目标有astropy.table
个坐标(在RA& Dec中),我想使用PyEphem(或其他软件包)用Rise&产生另外两个列。设置观察者参考框架中每个对象的时间。
我知道PyEphem有一个预安装对象的目录,如明星和行星,但我想要做的是利用其location.next_setting(ephem.Object())
和location.next_rising(ephem.Object())
函数计算我的目标列表何时可观察的,不仅仅是明亮的恒星和行星。
我知道那里有PyEphem的替代品,到目前为止我已经尝试安装Astroplan但没有成功(不确定这是否稳定),我已经调查了Skyfield,但我没有看到PyEphem之上的任何额外功能还没有。
这类似于我的表格现在的样子,添加了最后两列作为我想要它的例子。
RA Dec Apparent Magnitude Rise Time Set Time
deg deg
float64 float64 float64
0.0 90.0 20.1080708665 06:04:34 22:43:17
18.9473684211 80.5263157895 22.7223534546 06:25:01 22:21:56
37.8947368421 71.0526315789 19.4416167208
56.8421052632 61.5789473684 20.7207435685
75.7894736842 52.1052631579 19.9318711443
94.7368421053 42.6315789474 23.8544483535
113.684210526 33.1578947368 15.8981196334
132.631578947 23.6842105263 24.2866475431
151.578947368 14.2105263158 15.9503148326
170.526315789 4.73684210526 16.5505303858
189.473684211 -4.73684210526 24.194771397
答案 0 :(得分:4)
您确实提到过您可能对PyEphem
的替代方案感兴趣,因此我将为您提供一种方法astroplan
:
这里唯一的障碍是您必须设置不同的坐标,因为astroplan
可以处理list
SkyCoord
但不 a {{1包含数组......
SkyCoord
然后看着时间看起来似乎有些合理,即使最后一步打印了多个# What to look at
coordinates = SkyCoord(ra=np.linspace(0, 360, 20) *u.degree,
dec=np.linspace(-60, 60, 20) *u.degree)
# Replace these by you table-columns, e.g. ra=table['RA']
# Where is it observed
observer_location = Observer.at_site('lapalma') # Just as example
# When to observe
time = Time(['2016-03-18 01:00:00']) # Today ... there probably is even a convenience for this
# The ugly part... with the list comprehension
coordinates2 = [i for i in coordinates]
# Calculate the time of rise/set
rise = observer_location.target_rise_time(time, coordinates2, which='next')
set = observer_location.target_set_time(time, coordinates2, which='next')
有限的精度......
WARNINGS
剩下的可能只是设置坐标/时间/站点并在表格中插入两个新列。