Save FITS table:关键字描述及其值太长
Save FITS table: The keyword description with its value is too long
尝试将使用 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')
这是一个 returns 以以下结尾的长错误消息:
ValueError: The keyword description with its value is too long
问题是 table.meta['description']
比您尝试保存的适合文件的 header 允许的长。您可以简单地将它缩短到 80 个字符以下,然后尝试再次编写 test.fits
:
table.meta['description'] = u'AKARI/IRC All-Sky Survey Point Source Catalogue v. 1.0'
table.write('test.fits')
尝试将使用 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')
这是一个 returns 以以下结尾的长错误消息:
ValueError: The keyword description with its value is too long
问题是 table.meta['description']
比您尝试保存的适合文件的 header 允许的长。您可以简单地将它缩短到 80 个字符以下,然后尝试再次编写 test.fits
:
table.meta['description'] = u'AKARI/IRC All-Sky Survey Point Source Catalogue v. 1.0'
table.write('test.fits')