Skip to main content

QFitsWidget

A Qt widget for displaying FITS images, written in Python. It works with PySide6 or PyQt via qtpy.

Features

  • QFitsWidget shows an astropy PrimaryHDU, with cuts, stretch and colormap controls.
  • When the header has a WCS, the sky position under the mouse is available, for example in the context menu.
  • Optional overlays: center mark, compass directions, text overlay and a zoom view. Each one can be switched on and off and has its own color.
  • Image overlays: data layers drawn on top of the image (e.g. a cloud map) with their own colormap and opacity, set with set_overlay(). NaN pixels are transparent, and the values under the mouse are shown in the text overlay.
  • A customizable context menu. Header entries are Jinja templates, so you can show e.g. the RA/Dec of the clicked position.
  • QImageWidget shows raw image data (not FITS) with the same stretch controls, and StretchControls can be used on its own.

Installation

pip install qfitswidget

You also need a Qt binding, for example pip install pyside6.

Usage

import sys

from astropy.io import fits
from qtpy import QtWidgets

from qfitswidget import QFitsWidget, MenuHeader, MenuAction


def offset_telescope(pixel, wcs):
    print(f"Clicked pixel {pixel}, sky position {wcs}")


app = QtWidgets.QApplication(sys.argv)

viewer = QFitsWidget()
viewer.set_menu(
    [
        MenuHeader("RA: {{wcs.ra|hms}}, Dec: {{wcs.dec|dms}}"),
        MenuAction("Offset telescope to position", offset_telescope),
    ]
)
viewer.display(fits.open(sys.argv[1])[0])
viewer.resize(800, 600)
viewer.show()

sys.exit(app.exec())

test.py in this repository is a slightly longer version of this example.

Development

uv sync
uv run pytest

See CONTRIBUTING.md for the full workflow.

License

MIT, see LICENSE.

3rd party

Metadata

Release files for qfitswidget 1.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qfitswidget 1.3.3
File Size Uploaded Provenance Actions
qfitswidget-1.3.3.tar.gz 27.4 kB Without provenance Details for qfitswidget-1.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qfitswidget 1.3.3
File Interpreter ABI Platform Actions
qfitswidget-1.3.3-py3-none-any.whl Python 3 none any Details for qfitswidget-1.3.3-py3-none-any.whl

Total release size: 60.5 kB

Release files / qfitswidget-1.3.3.tar.gz

Download URL qfitswidget-1.3.3.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6b8afdcdf93d40f50750b1dd428c2daf33311b72806c4d8cd7d17483ce9a03ef
BLAKE2b-256 checksum
How to use checksums
17fe2db60fd6784b96009cd939d7316a8f4a4af17a32bbaceb040c064ac9f16d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qfitswidget-1.3.3-py3-none-any.whl

Download URL qfitswidget-1.3.3-py3-none-any.whl
Size 33.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3289351c71ddab1391187f82cd0b20dcac74d3199e42aca3b4df7666e62b24b6
BLAKE2b-256 checksum
How to use checksums
271011fcb8c4fd77d621c28b118d505b795733ec499c3ac6361a890a971c6197
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for qfitswidget 1.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page