我刚开始使用python进行测光,所以我正在学习Photutils教程中的背景提取、光圈测光等等。我在python3中使用了一个笔记本,并使用anaconda下载了最新的Photutils包。当我尝试这样做时:
from photutils import CircularAperture
positions = [(30., 30.), (40., 40.)]
apertures = CircularAperture(positions, r=3.)
from astropy import units as u
from astropy.coordinates import SkyCoord
from photutils import SkyCircularAperture
positions = SkyCoord(l=[1.2, 2.3] * u.deg, b=[0.1, 0.2] * u.deg,
frame='galactic')
apertures = SkyCircularAperture(positions, r=4. * u.arcsec)
我收到错误无法导入名称“NUMPY”
对于from photutils import Background2D、MedianBackground和import make_source_mask也是如此
有什么想法吗?在
谢谢! 海伦
你有什么版本的Astropy和photutils?在
你可以通过
注意,最新版本是photutils0.5(参见https://pypi.org/project/photutils/#history),我使用Github搜索
NUMPY_LT_1_14_1
找到了{a2},它包含了对此的更改,应该包含在photutils0.5中。在如果你有一个旧的photutils,解决方案是更新。如果您有最新版本0.5,请在https://github.com/astropy/photutils/issues/new打开一个问题,并在问题报告中发布触发错误和结果回溯的代码,以及您的photutils和Astropy版本号吗?在
相关问题 更多 >
编程相关推荐