Skip to content

Instantly share code, notes, and snippets.

@saimn
Last active August 29, 2015 14:10
Show Gist options
  • Save saimn/f75f8926ec2153b2a0fa to your computer and use it in GitHub Desktop.
Save saimn/f75f8926ec2153b2a0fa to your computer and use it in GitHub Desktop.
FITS Verify error
from astropy.io import fits
from astropy.wcs import WCS
hdu = fits.open('muse/CoreLib-1.1.12/data/obj/image.fits.gz')
header = hdu[0].header
print header
wcs = WCS(header)
In [2]: from astropy.io import fits
In [3]: from astropy.wcs import WCS
In [4]: hdu = fits.open('muse/CoreLib-1.1.12/data/obj/image.fits.gz')
In [5]: header = hdu[0].header
In [6]: header
Out[6]:
<repr(<astropy.io.fits.header.Header at 0x7ff589e02450>) failed: astropy.io.fits.verify.VerifyError:
Verification reported errors:
Unfixable error: Illegal keyword name 'IRAF-B/P'
Note: PyFITS uses zero-based indexing.
>
In [7]: wcs = WCS(header)
WARNING: FITSFixedWarning: RADECSYS= 'FK5 '
RADECSYS is non-standard, use RADESYSa. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: RADECSYS= 'FK5 '
RADECSYS is non-standard, use RADESYSa.
from astropy.io import fits
from astropy.wcs import WCS
hdu = fits.open('muse/CoreLib-1.1.12/data/obj/image.fits.gz')
wcs = WCS(hdu[0].header)
In [6]: from astropy.io import fits
In [7]: from astropy.wcs import WCS
In [8]: hdu = fits.open('muse/CoreLib-1.1.12/data/obj/image.fits.gz')
In [9]: wcs = WCS(hdu[0].header)
---------------------------------------------------------------------------
VerifyError Traceback (most recent call last)
<ipython-input-9-b34eb00ab085> in <module>()
----> 1 wcs = WCS(hdu[0].header)
/home/simon/lib/virtualenvs/mpdaf/lib/python2.7/site-packages/astropy/wcs/wcs.pyc in __init__(self, header, fobj, key, minerr, relax, naxis, keysel, colsel, fix, translate_units, _do_set)
324 header_string = header
325 elif isinstance(header, fits.Header):
--> 326 header_string = header.tostring()
327 else:
328 try:
/home/simon/lib/virtualenvs/mpdaf/lib/python2.7/site-packages/astropy/io/fits/header.pyc in tostring(self, sep, endcard, padding)
639 lines = []
640 for card in self._cards:
--> 641 s = str(card)
642 # Cards with CONTINUE cards may be longer than 80 chars; so break
643 # them into multiple lines
/home/simon/lib/virtualenvs/mpdaf/lib/python2.7/site-packages/astropy/io/fits/card.pyc in __str__(self)
460
461 def __str__(self):
--> 462 return self.image
463
464 def __len__(self):
/home/simon/lib/virtualenvs/mpdaf/lib/python2.7/site-packages/astropy/io/fits/card.pyc in image(self)
764
765 if self._image and not self._verified:
--> 766 self.verify('fix')
767 if self._image is None or self._modified:
768 self._image = self._format_image()
/home/simon/lib/virtualenvs/mpdaf/lib/python2.7/site-packages/astropy/io/fits/verify.pyc in verify(self, option)
118 warnings.warn(line, VerifyWarning)
119 else:
--> 120 raise VerifyError('\n' + '\n'.join(messages))
121
122
VerifyError:
Verification reported errors:
Unfixable error: Illegal keyword name 'IRAF-B/P'
Note: PyFITS uses zero-based indexing.
In [10]: wcs = WCS(hdu[0].header)
WARNING: FITSFixedWarning: RADECSYS= 'FK5 '
RADECSYS is non-standard, use RADESYSa. [astropy.wcs.wcs]
WARNING:astropy:FITSFixedWarning: RADECSYS= 'FK5 '
RADECSYS is non-standard, use RADESYSa.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment