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

Cannot open GZip compressed file #160

Closed
karlwessel opened this issue Mar 14, 2021 · 3 comments
Closed

Cannot open GZip compressed file #160

karlwessel opened this issue Mar 14, 2021 · 3 comments

Comments

@karlwessel
Copy link

When I try to open a GZipped file (.fits.gz-extension) I get the following error message

julia> using FITSIO

julia> FITS("pyobs-20210305-0228-e00.fits.gz")
ERROR: CFITSIO has encountered an error while processing pyobs-20210305-0228-e00.fits.gz. Error code 113: could not allocate memory
Detailed error message follows: 
Failed to reduce size of allocated memory (compress_open)
failed to find or open the following file: (ffopen)
pyobs-20210305-0228-e00.fits.gz

Stacktrace:
 [1] fits_assert_ok at .julia/packages/CFITSIO/uzw9u/src/CFITSIO.jl:205 [inlined]
 [2] fits_open_file(::String, ::Int64) at .julia/packages/CFITSIO/uzw9u/src/CFITSIO.jl:294
 [3] FITS(::String, ::String) at .julia/packages/FITSIO/dBcm0/src/FITSIO.jl:170 (repeats 2 times)
 [4] top-level scope at REPL[4]:1

Opening the file with astropy works fine.

If you want I can also upload the fits file where it does not work.

This is the state of my environment:

(jl_BYqwHQ) pkg> st
Status `/tmp/jl_BYqwHQ/Project.toml`
  [525bcba6] FITSIO v0.16.7
@giordano
Copy link
Member

It works for me with this FITS file, compressed with gzip:

julia> using FITSIO

julia> FITS("WFPC2u5780205r_c0fx.fits.gz")
File: WFPC2u5780205r_c0fx.fits.gz
Mode: "r" (read-only)
HDUs: Num  Name                   Type        
      1                           Image       
      2    u5780205r_cvt.c0h.tab  ASCIITable  

But 99% this is an upstream issue with CFITSIO, we don't do anything special to open compressed files (differently from Astropy, see #135)

@karlwessel
Copy link
Author

Thanks for the quick check!

For that one it works for me to. It also works if I create a gzipped FITS file with astropy.

Don't know whats wrong with that file.

For now I will just use GZip.jl to decompress the file it into a temporary file beforehand.

@karlwessel
Copy link
Author

I will close this, since it seems to be some special problem with my file. And maybe it could be solved by FileIOs handling of compressed files...

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

2 participants