esheldon / fitsio

A python package for FITS input/output wrapping cfitsio
GNU General Public License v2.0
134 stars 58 forks source link

Feature request: Is it possible to access the raw data in an FPACK-compressed HDU? #214

Open dstndstn opened 5 years ago

dstndstn commented 5 years ago

Apologies if I am just missing something, but here's my situation:

In astropy.io.fits, they provide an hdu.compressed_data field that gives you access to the underlying BINTABLE. It would be awesome if fitsio could provide something similar (eg, fitsio.read(filename, ext=None, decompress=True))!

dstndstn commented 5 years ago

PS, an alternative API / great feature would be a call that retrieved a quantization error map!

esheldon commented 5 years ago

I imagine there is a way to do this from cfitsio. I'm using the "standard" routines for querying the fits file, maybe it can be queried differently.

But note this information would not generally be visible the way the code works now. I think it would make most sense to have a different kind of opening mode.

beckermr commented 5 years ago

Years ago I hit a bug where I read a compressed image as a table and was super confused. This must have been fixed by now since I cannot reproduce it.