This Python script extracts metadata from FITS (Flexible Image Transport System) files, commonly used in astronomy. It reads the file, gathers metadata from each Header/Data Unit (HDU), and outputs it in a readable format.
- Extracts and displays metadata from all HDUs in a FITS file.
- Option to pretty-print the output for enhanced readability.
Run the script with the path to a FITS file:
./fits_extract.py path/to/your/fits_file.fits
pipenv run python fits_extract.py
For a pretty-printed JSON output:
./fits_extract.py path/to/your/fits_file.fits --pretty
For help
./fits_extract.py --help
- Python 3
- Astropy package (install via
pip install astropy
)