没有名称' astropy.wcs'

发布于 2025-02-11 22:42:19 字数 562 浏览 0 评论 0原文

我正在执行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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不打扰别人 2025-02-18 22:42:19

确保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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文