尝试将使用astroquery检索的astropy表保存到FITS文件时出错。在某些情况下,它抱怨某些关键字的描述太长。writeto()
函数似乎有一个output_verify
参数来避免这种问题,但是我找不到如何将它传递给write()
函数?它存在吗?
这是我的密码:
import astropy.units as u
from astroquery.vizier import Vizier
import astropy.coordinates as coord
from astropy.table import Table
akari_query=Vizier(columns=["S09","S18","e_S09","e_S18","q_S09","q_S18"],catalog=["II/297/irc"])
result=akari_query.query_region(coord.SkyCoord(ra=200.0, dec=10.0,unit=(u.deg, u.deg),frame='icrs'), width=[2.0*u.deg,2.0*u.deg],return_type='votable')
table=Table(result[0], masked=True)
table.write('test.fits')
它返回一条以以下结尾的长错误消息:
ValueError: The keyword description with its value is too long
问题是
table.meta['description']
比您试图保存的fits文件头所允许的长度要长。您只需将其缩短到80个字符以下,然后再次尝试写入test.fits
:相关问题 更多 >
编程相关推荐