没有名称' astropy.wcs'
我正在执行python的代码,我想使用此信息:
from astropy.wcs import WCS
但是当我运行代码时,我有一个错误:modulenotfounderror:没有名为'astropy.wcs'的模块 这是我的代码:
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits
from astropy.wcs import WCS
archivo_fits=fits.open('Eurybates_sky.fits')
type(archivo_fits)
print(archivo_fits.info())
print(archivo_fits[0].header)
ra=Angle(' 06d59m31.64s')
dec=Angle('+29d56m45.5s')
RA=ra.degree
DEC=dec.degree
w=WCS('Eurybates_sky.fits')
x,y=w.all_world2pix(RA,DEC,1)
print(x,y)
i'm doing a python's code, and i want to use this:
from astropy.wcs import WCS
But when i run my code, i have this error: ModuleNotFoundError: No module named 'astropy.wcs'
This is my code:
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits
from astropy.wcs import WCS
archivo_fits=fits.open('Eurybates_sky.fits')
type(archivo_fits)
print(archivo_fits.info())
print(archivo_fits[0].header)
ra=Angle(' 06d59m31.64s')
dec=Angle('+29d56m45.5s')
RA=ra.degree
DEC=dec.degree
w=WCS('Eurybates_sky.fits')
x,y=w.all_world2pix(RA,DEC,1)
print(x,y)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保Astropy安装在与Python安装的同一安装目录树中,打开一个新终端并尝试:PIP安装Astropy
Make sure astropy was installed in the same installation directory tree as your Python installation, open a new terminal and try: pip install astropy