MATLAB: How to read the fits file content from gz file without extracting them.

.gzfitsmatalbMATLAB

Hi, I have a lot of gz files. If unzip them, it will consuming much storage space.
So, how can i get "fits" content from gz file without unzipping them.
PS: one "fits" file only in one gz file
Thanks in advance.

Best Answer

There are some useful zip utilities in the File Exchange
However,
"how can i get "fits" content from gz file without unzipping them"
With the above utilities, especially zmat, you could unzip into memory. However, it would be the entire file that was unzipped. It might happen that the file itself is just the result of fwrite() of a bunch of binary data that is all the same datatype; in such cases then a typecast() later you would have your array of data. But much more common is that the file itself contains headers and possibly various encoded data, and would have to be interpreted by an appropriate routine in order to extract the data. The appropriate routines probably are not expecting to process from memory as a source.
Related Question