Python 从FITS图像返回WCS时出现问题

Python 从FITS图像返回WCS时出现问题,python,astropy,wcs,Python,Astropy,Wcs,我正在使用astropy加载FITS图像并从中检索WCS from astropy.io import fits from astropy.wcs import WCS with fits.open('hst_A2744_f606w_drz.fits') as hdul: wcs = WCS(hdul[1]) print(wcs) 返回 WCS Keywords Number of WCS axes: 2 CTYPE : 'RA---TAN' 'DEC--TAN' CR

我正在使用astropy加载FITS图像并从中检索WCS

from astropy.io import fits
from astropy.wcs import WCS

with fits.open('hst_A2744_f606w_drz.fits') as hdul:
    wcs = WCS(hdul[1])
    print(wcs)

返回

WCS Keywords

Number of WCS axes: 2
CTYPE : 'RA---TAN'  'DEC--TAN'
CRVAL : 3.587755699764648  -30.39711750881429
CRPIX : 3000.4999999998081  2989.499999999809
CD1_1 CD1_2  : -1.3888888888888e-05  0.0
CD2_1 CD2_2  : 0.0  1.3888888888889599e-05
NAXIS : 6000  5978
我的目标是以字符串、元组或数组的形式返回CRVAL,如下所示:
(3.587755699764648,-30.39711750881429)

我尝试以
wcs['CTYPE']
wcs[CTYPE]
wcs.CTYPE
的形式访问它,但所有返回的都是错误。

您想要吗

特别是(或者
WCS.WCS.ctype
,因为在您编写的问题中,您需要
CRVAL
值,但您尝试查找
ctype
值)