Astropy中打开二进制表列宽时崩溃

2024-04-24 22:05:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我想打开一个保存在FITS文件中的二进制表。我正在使用Python,但我也尝试过fv和SAOImageDS9。你知道吗

from astropy.io import fits
f=fits.open('ioa_pmotion.fits')
f.info() #this shows that the binary table is in extension 1
f[0].data #this responds with "None" because the primary (extension 0) is empty
f[1].data #here is where the error occurs
g=f[1].data
print(g[0]) #this should show the first row of the table

第五行出现的错误是,“有符号整数大于最大值。”

从第3行开始,我被告知该表有1行18列,但它也有超过8gb的空间。我正在尝试访问这些8gb的数据,但我不知道如何访问它们。我已经收到了18列中每一列的标题,它们是我试图检索的数据类型的名称(对象ID、固有运动值、消光值等),所以我想知道这些数据是否以某种方式存储在这些列中。你知道吗

Column names

Full traceback


Tags: 文件the数据fromdataisextensiontable