Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading very large .fits.gz file fails. #255

Open
rainwoodman opened this issue Jun 10, 2019 · 6 comments
Open

Reading very large .fits.gz file fails. #255

rainwoodman opened this issue Jun 10, 2019 · 6 comments

Comments

@rainwoodman
Copy link
Contributor

We (@ekitanidis) were trying to read a 2.1GB .fits.gz file (legacy survey DR8 annotated CCD file, prerelease). The read operation failed with cfitsio internal error.

Seems to be when it is opening the inmemory file for decompression -- could be because the decompressed file is greater than 4GB.

astropy was able to read the same file without a problem. Is this something we can fix?

@esheldon
Copy link
Owner

This is the same issue as #199

@esheldon
Copy link
Owner

Where do we stand on this issue? Does it work for the latest version (1.1.3), for which we have updated cfitsio version to 3.49?

@dstndstn
Copy link
Contributor

Coming back to this much later... with a fresh build (1.1.7-2-g59fba1e) I am still getting an error trying to read a large .fits.gz (3.4 GB compressed, 9.1 GB uncompressed):

> python -c "import fitsio; print(fitsio.__file__); fitsio.read('/global/cfs/cdirs/cosmo/work/legacysurvey/dr10/ccds-annotated-dr10-v5.fits.gz')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/global/u1/d/dstn/fitsio2/fitsio/fitslib.py", line 139, in read
    with FITS(filename, **kwargs) as fits:
  File "/global/u1/d/dstn/fitsio2/fitsio/fitslib.py", line 520, in __init__
    self._FITS = _fitsio_wrap.FITS(filename, self.intmode, create)
OSError: FITSIO status = 414: error uncompressing image
failed to uncompress file into memory (compress_open)
failed to find or open the following file: (ffopen)
/global/cfs/cdirs/cosmo/work/legacysurvey/dr10/ccds-annotated-dr10-v5.fits.gz

On the plus side, fitsio can read the uncompressed version just fine.

Let me know if there's any debugging I can do to help. Thanks!

@esheldon
Copy link
Owner

Can you read subsets of rows or columns?

@dstndstn
Copy link
Contributor

Hi, unfortunately it doesn't look like reading row or column subsets helps;
fitsio.read('/global/cfs/cdirs/cosmo/work/legacysurvey/dr10/ccds-annotated-dr10-v5.fits.gz', columns=['expnum'])
and
fitsio.read('/global/cfs/cdirs/cosmo/work/legacysurvey/dr10/ccds-annotated-dr10-v5.fits.gz', rows=[0])
yield the same error as above.

@esheldon
Copy link
Owner

I think we might need to report this to the cfitsio maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants