python - Cannot open file with PyFITS -
i've got .fit
files containing images ccd camera , can't seem open them using pyfits. i'm complete newbie pyfits don't know (if any) options have. here's i'm trying:
import pyfits hdulist = pyfits.open('apex5_1_90s.fit')
which returns error:
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.
if on other hand try:
import pyfits hdulist = pyfits.open('apex5_1_90s.fit', ignore_missing_end=true)
i told:
error validating header hdu #1 (note: pyfits uses zero-based indexing). header size not multiple of 2880: 1920 there may bytes after last hdu or file corrupted.
i don't know means , i've no idea can it, appreciated!
it's seems file corrupted or have issues header. sure have valid fits file? based on pyfits documentation:
problem fits format that, old is, there many conventions appear in files sources not meet fits standard. , yet common-place necessary support them in fits readers. continue cards 1 such example.
(...) if pyfits having trouble opening file, way rule out whether not problem pyfits run file through fitsverify. if file malformatted, fitsverify output errors , warnings. if fitsverify confirms no problems file, , pyfits still having trouble opening (...) it’s there bug in pyfits.
Comments
Post a Comment