Astropy:来自swift拟合文件的物理坐标

时间:2016-09-26 09:11:03

标签: coordinates astropy fits

契合files (不必登录,继续查看和下载)。

据我所知不相关(如果我错了,请纠正我):

Find physical coordinates of a pixel in a fits file with python

重现:

from astropy.io import fits
from astropy.wcs import WCS
ev=fits.open('sw00032188013xpcw3po_cl.evt.gz')
w=WCS(ev['events'].header)
w.wcs_pix2world(290,500,0)

结果:

[array(291.0), array(501.0)]

w.to_header()似乎没问题,但我注意到使用w.wcs_pix2world(290,500,0,ra_dec_order=True)会产生一个奇怪的错误:

ValueError: WCS does not have longitude type of 'RA', therefore (ra, dec) data can not be returned

ds9读取此文件并显示fk5坐标没有问题。

非常感谢提前!

PS: 我正在使用稳定的Debian 8软件包,astropy.version.version ='0.4.2'

1 个答案:

答案 0 :(得分:0)

您正在使用XRT事件文件。那不是图像文件。 DS9为您做了一些解释,并可以自动从中创建图像,包括WCS。 astropy.wcs解释得更少,并且(很容易)能够为其创建具有正确WCS的图像。
(您可以选择将DS9图像保存为单个图像。)

相反,您应该阅读Swift XRT manual以了解如何从XRT事件文件创建图像。这也将照顾GTI和坏像素 通常,这是从HEASoft软件套件using some tools完成的。

或者,我希望还有自动化的3级产品available for download,包括实际图像(按照我上面描述的方式创建)。你可能最好不要使用它们。