我有一些.fit
文件包含来自 CCD 相机的图像,但我似乎无法使用 PyFITS 打开它们。我是 PyFITS 的新手,所以我不知道我有什么(如果有的话)选项。这是我正在尝试的:
import pyfits
hdulist = pyfits.open('apex5_1_90s.fit')
返回错误:
Traceback (most recent call last):
File "\\uol.le.ac.uk\root\staff\home\l\lvh8\Desktop Files\Prototype Data\spextract.py", line 3, in <module>
hdulist = pyfits.open('apex5_1_90s.fit')#, ignore_missing_end=True)
File "C:\Python27\lib\site-packages\pyfits\hdu\hdulist.py", line 118, in fitsopen
return HDUList.fromfile(name, mode, memmap, save_backup, **kwargs)
File "C:\Python27\lib\site-packages\pyfits\hdu\hdulist.py", line 250, in fromfile
save_backup=save_backup, **kwargs)
File "C:\Python27\lib\site-packages\pyfits\hdu\hdulist.py", line 803, in _readfrom
hdu = _BaseHDU.readfrom(ffo, **kwargs)
File "C:\Python27\lib\site-packages\pyfits\hdu\base.py", line 299, in readfrom
hdr = Header.fromfile(fileobj, endcard=not ignore_missing_end)
File "C:\Python27\lib\site-packages\pyfits\header.py", line 476, in fromfile
raise IOError('Header missing END card.')
IOError: Header missing END card.
另一方面,如果我尝试:
import pyfits
hdulist = pyfits.open('apex5_1_90s.fit', ignore_missing_end=True)
我被告知:
Error validating header for HDU #1 (note: PyFITS uses zero-based indexing).
Header size is not multiple of 2880: 1920
There may be extra bytes after the last HDU or the file is corrupted.
我真的不知道这意味着什么,我不知道我能做些什么,所以任何帮助将不胜感激!