DESIHIGH / desihigh

An introduction to DESI & Dark Energy for high schoolers with hot-off-the-telescope data! :telescope:
BSD 3-Clause "New" or "Revised" License
46 stars 80 forks source link

error reading fits file in Clusters.ipynb #88

Open alxogm opened 2 years ago

alxogm commented 2 years ago

I'm getting the following error, in section Clusters observed by DESI of Clusters.ipynb,

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
/tmp/ipykernel_69/3226039553.py in <module>
      6     download(url, './tmp/')
      7 
----> 8     cats[t] = fitsio.read('./tmp/desihigh_{}'.format(os.path.basename(url)))
      9 
     10     print(t, './tmp/desihigh_{}'.format(os.path.basename(url)))

/srv/conda/envs/notebook/lib/python3.7/site-packages/fitsio/fitslib.py in read(filename, ext, extver, columns, rows, header, case_sensitive, upper, lower, vstorage, verbose, trim_strings, **keys)
    137         read_kwargs['rows'] = rows
    138 
--> 139     with FITS(filename, **kwargs) as fits:
    140 
    141         if ext is None:

/srv/conda/envs/notebook/lib/python3.7/site-packages/fitsio/fitslib.py in __init__(self, filename, mode, lower, upper, trim_strings, vstorage, case_sensitive, iter_row_buffer, write_bitcols, ignore_empty, verbose, clobber, **keys)
    518 
    519         self._did_create = (create == 1)
--> 520         self._FITS = _fitsio_wrap.FITS(filename, self.intmode, create)
    521 
    522     def close(self):

OSError: FITSIO status = 108: error reading from FITS file
Error reading data buffer from file:
./tmp/desihigh_redmapper_dr8_public_v5.10_catalog.fits
ffopen could not interpret primary array header of file: 
./tmp/desihigh_redmapper_dr8_public_v5.10_catalog.fits

I've tried both in Binder and Colab. BTW, if we could use astropy to read the fits file would be better since Colab doesn't have fitsio by default, we could install it, but would be simpler if we use astropy...

michaelJwilson commented 2 years ago

@jtmyles any chance you could take a quick look at this?

michaelJwilson commented 2 years ago

89 should contain the fix (thanks @jtmyles), but admittedly is showing errors of 'not json of notebook'. To be investigated further.

cylammarco commented 2 years ago

Would you please copy the entire error message @michaelJwilson?