2

我正在尝试使用healpy以下脚本以 HEALPix 格式编写 FITS 文件:

import healpy as hp

fname = 'COM_CMB_IQU-100-fgsub-sevem_2048_R3.00_full.fits'

map1 = hp.read_map(fname, field=[0], nest=True)
map2 = hp.read_map(fname, field=[1], nest=True)
map3 = hp.read_map(fname, field=[2], nest=True)

hp.write_map('tst1.fits', m=[map1, map2, map3], fits_IDL=False, nest=True)

这会引发以下错误:

/usr/lib/python2.7/dist-packages/healpy/fitsfunc.py:151:
PyfitsDeprecationWarning: The new_table function is deprecated as of
version 3.3 and may be removed in a future version.

Use :meth:`BinTableHDU.from_columns` for new BINARY tables or
:meth:`TableHDU.from_columns` for new ASCII tables instead.   tbhdu =
pf.new_table(cols) Traceback (most recent call last):   File
"write_fits.py", line 13, in <module>
    hp.write_map('tst1.fits',m=[map1, map2, map3], fits_IDL= False, nest= True)   File
"/usr/lib/python2.7/dist-packages/healpy/fitsfunc.py", line 153, in
write_map
     tbhdu.header.update('PIXTYPE','HEALPIX','HEALPIX pixelisation')   File "/usr/lib/python2.7/dist-packages/pyfits/header.py", line 1017,
in update
    'value, and comment string.' % idx) ValueError: Header update sequence item #0 is invalid; the item must either be a 2-tuple
containing a keyword and value, or a 3-tuple containing a keyword,
value, and comment string.

任何帮助表示赞赏!

4

0 回答 0