Python FITS Decompressor
Astronomy data often comes in the form of FITS files. To save space, many surveys and observatories provide them as .fits.fz compressed files. Before using these files for analysis or astrophotography, they need to be converted back into standard .fits.
I created a small Python script called fits-decompressor. It takes all the .fits.fz files from a folder, decompresses them, and saves them as normal .fits files in another folder. If the file contains image data, the script can also display it using Matplotlib.
Why use this tool?
Quick way to handle large numbers of compressed FITS files
Works automatically on all files in the chosen folder
The output can be used in most astronomy software
Allows a direct preview of numeric image data
How to use it
1. Install the requirements
Make sure Python 3.8 or newer is installed, then install the needed libraries:
2. Prepare your folders
-
Place your
.fits.fzfiles in an input folder -
Choose an output folder for the decompressed
.fitsfiles
3. Edit the script
Update the folder paths in the script:
4. Run the script
In the terminal, move to the folder where decompress_fits.py is located and run:
5. Check the results
The script will decompress all .fits.fz files into .fits and save them in the output folder. If there is image data, a preview will appear on the screen.
Download
The script is available on GitHub:
π https://github.com/MohammedHaimoud/fits-decompressor
Comments
Post a Comment