【发布时间】:2019-06-04 05:10:46
【问题描述】:
我有一个关于天文物体的拟合文件。我可以这样绘制:
from astropy.io import fits
from astropy.wcs import WCS
hdul = fits.open(fitsfilename)[0]
wcs = WCS(hdul.header)
fig = plt.figure(figsize=(12,12))
fig.add_subplot(111, projection=wcs)
plt.imshow(hdul.data)
这很有效,并产生了一张漂亮的照片:
我想在这个情节中添加一些额外的功能,但这是行不通的。例如,让我们尝试将一个圆添加到 119°,-67°30'。我将代码扩展为:
plt.scatter([119],[-67.5],c='r',s=500)
我得到的是:
这真的不是我们想要的,圆大约是 118°5',-67°5',而不是它应该在的位置(119°,-67°30')。
我做错了什么,或者有什么好的方法可以解决这个问题?
注意:当我运行 wcs = WCS(hdul.header) 时,我会收到警告:
警告:验证警告:验证报告错误: [astropy.io.fits.verify] 警告:验证警告:卡“A_2_0”不是 FITS 标准(无效值字符串:'3.29341755408e-05')。固定的 'A_2_0' 卡符合 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:注意:astropy.io.fits 使用从零开始的 索引。 [astropy.io.fits.verify] 警告:验证警告:卡 'A_1_1' 不是 FITS 标准(无效值字符串: '1.51709339878e-05')。修复了“A_1_1”卡以满足 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'A_0_2' 不是 FITS 标准(无效值字符串:'5.17973753556e-06')。固定的 'A_0_2' 卡符合 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡“B_2_0”不是 FITS 标准(无效 值字符串:'2.97627426087e-06')。修复了“B_2_0”卡以满足 适合标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'B_1_1' 不是 FITS 标准(无效值字符串: '2.71948126373e-05')。修复了“B_1_1”卡以满足 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡“B_0_2”不是 FITS 标准(无效值字符串:'1.66848449653e-05')。固定的 'B_0_2' 卡符合 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡“AP_1_0”不是 FITS 标准(无效 值字符串:'1.79541533196e-06')。修复了“AP_1_0”卡以满足 适合标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'AP_0_1' 不是 FITS 标准(无效值字符串: '9.20624843151e-07')。修复了“AP_0_1”卡以满足 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡“AP_2_0”不是 FITS 标准(无效值字符串:'-3.29292923201e-05')。固定的 'AP_2_0' 卡符合 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡“AP_1_1”不是 FITS 标准(无效 值字符串:'-1.51738446887e-05')。修复了“AP_1_1”卡以满足 适合标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'AP_0_2' 不是 FITS 标准(无效值字符串: '-5.18321445978e-06')。修复了“AP_0_2”卡以满足 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'BP_1_0' 不是 FITS 标准(无效值字符串:'8.99029048217e-07')。固定的 'BP_1_0' 卡符合 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'BP_0_1' 不是 FITS 标准(无效 值字符串:'1.15967736014e-06')。修复了“BP_0_1”卡以满足 适合标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'BP_2_0' 不是 FITS 标准(无效值字符串: '-2.97837492348e-06')。修复了“BP_2_0”卡以满足 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'BP_1_1' 不是 FITS 标准(无效值字符串:'-2.71998518336e-05')。固定的 'BP_1_1' 卡符合 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'BP_0_2' 不是 FITS 标准(无效 值字符串:'-1.66872388359e-05')。修复了“BP_0_2”卡以满足 适合标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'WCSR_PRJ' 不是 FITS 标准(无效值字符串:'3.6679e-07')。 修复了 'WCSR_PRJ' 卡以满足 FITS 标准。 [astropy.io.fits.verify] 警告:验证警告:卡 'WCSR_PIX' 是 不适合标准(无效值字符串:'8.2565e-05')。固定的 'WCSR_PIX' 卡符合 FITS 标准。 [astropy.io.fits.verify]
所以这可能是相关的;如何修复它的问题仍然存在。
【问题讨论】:
标签: python python-3.x matplotlib projection astropy