astropy/astroquery — pull request #227 by keflavich (2013-09-26 02:10:24+00:00)
Title: MAGPIS returns invalid FITS data

Example:
```
>>> from astropy import magpis
>>> img = magpis.Magpis.get_images('19h23m02.7s +14d28m48.09s','1 arcmin',survey='gps6epoch3')

WARNING: Coordinate string is being interpreted as an ICRS coordinate. [astroquery.utils.commons]
WARNING: VerifyWarning: Error validating header for HDU #0 (note: PyFITS uses zero-based indexing).
Header size is not multiple of 2880: 316
There may be extra bytes after the last HDU or the file is corrupted. [astropy.io.fits.hdu.hdulist]
ERROR: IOError: Empty or corrupt FITS file [astropy.io.fits.hdu.hdulist]
Traceback (most recent call last):
File "", line 1, in
img = magpis.Magpis.get_images('19h23m02.7s +14d28m48.09s','1 arcmin',survey='gps6epoch3')
File "/Users/adam/repos/astroquery/astroquery/utils/class_or_instance.py", line 25, in
f = lambda *args, **kwds: self.fn(cls, *args, **kwds)
File "/Users/adam/repos/astroquery/astroquery/magpis/core.py", line 86, in get_images
return fits.open(S, ignore_missing_end=True)
File "/Users/adam/repos/astropy/astropy/io/fits/hdu/hdulist.py", line 117, in fitsopen
return HDUList.fromfile(name, mode, memmap, save_backup, **kwargs)
File "/Users/adam/repos/astropy/astropy/io/fits/hdu/hdulist.py", line 249, in fromfile
save_backup=save_backup, **kwargs)
File "/Users/adam/repos/astropy/astropy/io/fits/hdu/hdulist.py", line 836, in _readfrom
raise IOError('Empty or corrupt FITS file')
IOError: Empty or corrupt FITS file

> /Users/adam/repos/astropy/astropy/io/fits/hdu/hdulist.py(843)_readfrom()
842 finally:
--> 843 compressed.COMPRESSION_ENABLED = saved_compression_enabled
844
```