我正在编写一个程序,它通过光度学检查 FITS 文件并查找 .dat 文件中给出的星星。其中一个步骤是使用 ephem.separation() 计算两个给定恒星之间的距离
它运作良好。但是,有时分离会返回像 1389660529:33:00.8 这样的角度
import ephem
import math
star = ['21:45:15.00', '65:49:24.0']
first_coo = ['21:45:15.00', '65:49:24.0']
check = ephem.FixedBody()
check._ra = ephem.hours(star[0])
check._dec = ephem.degrees(star[1])
check.compute()
# star is a list with coordinates, strings in form %s:%s:%s
first = ephem.FixedBody()
first._ra = ephem.hours(first_coo[0])
first._dec = ephem.degrees(first_coo[1])
first.compute()
sep = math.degrees(float(ephem.separation(check,first)))
print sep
它随机发生。有没有人遇到过这样的行为?
我在 212 个文件中搜索 18 颗星,循环次数为 3816。可能与它有关?