fits_header_fix.py — Bulk edit FITS header keywords with type casting

Fuente: Zenodo
Saved in:
Bibliographic Details
Main Author: B, Britt
Format: Recurso digital
Published: Zenodo 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866901725845127168
author B, Britt
author_facet B, Britt
contents <pre><code>fits_header_fix.py v1.0 — Bulk adds, removes, or renames keywords in FITS file headers with automatic type casting (int/float/bool/str). Features • Uses astropy for safe header manipulation • Automatic type casting for numerical and boolean values • In-place editing with update mode and checksum recalculation • Supports glob patterns for batch processing • Handles comments on added keywords • Safe output directory creation Intended for astronomers fixing non-standard or missing header keywords before pipeline processing. Usage example: python fits_header_fix.py "*.fits" --inplace --add "EXPTIME=30.0,Exposure time in seconds" --add "FILTER=r,SDSS r-band" python fits_header_fix.py old.fits --remove BADKEY --rename OLDNAME=NEWNAME -o fixed/ Made by Britt (2025) — MIT License</code></pre>
format Recurso digital
id zenodo_https___doi_org_10_5281_zenodo_17947262
institution Zenodo
language
publishDate 2025
publisher Zenodo
record_format zenodo
spellingShingle fits_header_fix.py — Bulk edit FITS header keywords with type casting
B, Britt
astronomy
FITS
header
keyword
editing
pipeline
astropy
python
cli tool
<pre><code>fits_header_fix.py v1.0 — Bulk adds, removes, or renames keywords in FITS file headers with automatic type casting (int/float/bool/str). Features • Uses astropy for safe header manipulation • Automatic type casting for numerical and boolean values • In-place editing with update mode and checksum recalculation • Supports glob patterns for batch processing • Handles comments on added keywords • Safe output directory creation Intended for astronomers fixing non-standard or missing header keywords before pipeline processing. Usage example: python fits_header_fix.py "*.fits" --inplace --add "EXPTIME=30.0,Exposure time in seconds" --add "FILTER=r,SDSS r-band" python fits_header_fix.py old.fits --remove BADKEY --rename OLDNAME=NEWNAME -o fixed/ Made by Britt (2025) — MIT License</code></pre>
title fits_header_fix.py — Bulk edit FITS header keywords with type casting
topic astronomy
FITS
header
keyword
editing
pipeline
astropy
python
cli tool
url https://doi.org/10.5281/zenodo.17947262