我在我的 Debian 服务器上使用 Python 2.7.3。这是输入代码:
import aplpy
import pyfits
from numpy import *
import matplotlib as plt
import montage as montage_wrapper
import PIL
r = pyfits.open('3c324IR.fits')
b = pyfits.open('3c324UVIS.fits')
g = pyfits.open('3c5GHZ.fits')
r.info()
g.info()
b.info()
print(r[1].header)
print(g[1].header)
print(b[1].header)
r1 = r[1].data
g1 = g[0].data
b1 = b[1].data
hdu = pyfits.PrimaryHDU(r1)
hdulist = pyfits.HDUList([hdu])
hdulist.writeto('r.fits')
hdu = pyfits.PrimaryHDU(g1)
hdulist = pyfits.HDUList([hdu])
hdulist.writeto('g.fits')
hdu = pyfits.PrimaryHDU(b1)
hdulist = pyfits.HDUList([hdu])
hdulist.writeto('b.fits')
aplpy.make_rgb_cube(['r.fits','g.fits','b.fits'], '3c_324_rgb.fits')
aplpy.make_rgb_image('3c_324_rgb.fits','3c_324_rgb.png')
f = aplpy.FITSFigure('3c_324_rgb.fits')
f.show_rgb()
f.save('3c_324_rgb2.png')
print 'END'
在我开始这aplpy.make_rgb_cube()
部分代码之前,一切正常。我知道这一点,因为当我启动它并将其删除时,它可以正常工作(直到它意识到这件作品没有输出可以继续)。这是终端中的混乱:
Traceback (most recent call last):
File "test9.py", line 47, in <module>
aplpy.make_rgb_cube(['r.fits','g.fits','b.fits'], '3c_324_rgb.fits')
File "/usr/local/lib/python2.7/dist-packages/aplpy/rgb.py", line 309, in make_rgb_cube
montage.mMakeHdr(images_raw_tbl, header_hdr, north_aligned=north, system=system, equinox=equinox)
File "/usr/local/lib/python2.7/dist-packages/montage_wrapper/commands.py", line 1468, in mMakeHdr
return status.parse_struct("mMakeHdr", p.stdout.read().strip())
File "/usr/local/lib/python2.7/dist-packages/montage_wrapper/status.py", line 33, in parse_struct
result = Struct(command, string)
File "/usr/local/lib/python2.7/dist-packages/montage_wrapper/status.py", line 70, in __init__
raise MontageError("%s: %s" % (command, self.msg))
montage_wrapper.status.MontageError: mMakeHdr: Invalid table file: /tmp/tmpmyYyN7/images_raw.tbl
我不知道上面的意思是什么。我已经通过它在谷歌中寻找一些东西,但我已经空了。这是什么错误,我该如何解决?