我正在使用 Python 2.7.10 和 pyfits 3.3。早些时候,我使用以下代码合并两个表。但是,现在我遇到了一些错误
t1 = pyfits.open(table1)[1].columns
t2 = pyfits.open(table2)[1].columns
new_columns = t1 + t2
hdu = pyfits.BinTableHDU.from_columns(new_columns)
hdu.writeto(outtable)
错误是:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vvikraman/anaconda2/lib/python2.7/site-packages/pyfits/hdu/table.py", line 116, in from_columns
data = FITS_rec.from_columns(coldefs, nrows=nrows, fill=fill)
File "/home/vvikraman/anaconda2/lib/python2.7/site-packages/pyfits/fitsrec.py", line 315, in from_columns
if arr.hdu.data is None:
ReferenceError: weakly-referenced object no longer exists