Skip to content

A simple (bulk) editor for keywords in fits files with good vibes.

License

Notifications You must be signed in to change notification settings

KlemenBlokar/fitsedit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fitsedit

A small FITS metadata editor with a Qt GUI plus batch tooling. It is designed to show tags from multiple FITS files in a configurable table, allow sorting by any tag, and apply edits to many files at once.

Getting started

  1. Create a virtualenv and install dependencies:
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"

If you do not need the GUI, install only astropy.

  1. Run the GUI:
python -m fitsedit.app
  1. Run tests headlessly (Qt offscreen):
export QT_QPA_PLATFORM=offscreen
pytest
  1. Batch apply edits without the GUI:
python -m fitsedit.cli spec.json

With a spec like:

{
  "files": ["image1.fits", "image2.fits"],
  "hdu_index": 0,
  "backup": true,
  "edits": [
    {"key": "OBSERVER", "value": "Alex"},
    {"key": "FILTER", "action": "delete"}
  ]
}

Features (initial skeleton)

  • Load multiple FITS files and view chosen header keywords in a sortable table
  • Configurable columns: choose which FITS keywords to show
  • Multi-row selection and a bulk edit dialog to set or delete tags across files
  • Dirty-state tracking with ability to Save all pending edits
  • Batch CLI to apply edits from a YAML/JSON spec without opening the GUI

Project layout

  • fitsedit/core.py — FITS I/O and bulk edit logic (GUI-independent)
  • fitsedit/models.py — Qt models/adapters for table data and column management
  • fitsedit/app.py — Qt widgets and main window wiring
  • fitsedit/cli.py — batch apply entrypoint using the same core logic
  • tests/ — pytest-based coverage of the core logic and Qt models

Notes on headless testing

Set QT_QPA_PLATFORM=offscreen (or run under xvfb-run) so PySide6 can initialize without a display server. The GUI smoke tests use pytest-qt to simulate user actions; most behavior is covered via pure Python tests in core.py.

About

A simple (bulk) editor for keywords in fits files with good vibes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages