[AstroPy] Re: [SciPy-user] pyfits question: handling gzipped fits files

Perry Greenfield perry at stsci.edu
Thu Jul 14 10:56:14 EDT 2005


Hi Russell,

The astropy list is probably a better forum for this.

On Jul 14, 2005, at 10:38 AM, Russell E. Owen wrote:

> Is there some reasonable way to get pyfits to read a gzipped fits file
> (in a way that works on Windows and unix)?
>
> I realize I can unzip the file first, but I was hoping to have it
> directly read (unzipped on the fly).
>
> I can't see any command that takes a file-like object (instead of a 
> file
> path), so I can't see how to take advantage of Python's gzip module.
>
> I realize I can just edit the code and add this in, but, well...if
> there's a better way I'd love to know about it and if there isn't, I'd
> like to request that it be modified to handle gzipped files
> automatically.

Not yet, but after version 1 is out, it's one of the first things we'd 
like to add (as well as support for the compression conventions that 
CFITSIO supports). We don't have time right now to do it (though it 
shouldn't be hard at all). If you or someone would like to add it, we 
would welcome such a patch.

Perry




More information about the AstroPy mailing list