pyfits question: handling gzipped fits files
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. -- Russell P.S. I hope this isn't a duplicate. I tried posting before I was a member of the list -- I read it on gmane -- and that posting was held.
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
participants (2)
-
Perry Greenfield
-
Russell E. Owen