QFitsWidget
A Qt widget for displaying FITS images, written in Python. It works with PySide6 or PyQt via qtpy.
Features
QFitsWidgetshows an astropyPrimaryHDU, 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.
QImageWidgetshows raw image data (not FITS) with the same stretch controls, andStretchControlscan 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
- Using icons from Font Awesome, licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).
Metadata
Release files for qfitswidget 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qfitswidget-1.3.1.tar.gz | 27.2 kB | Without provenance | Details for qfitswidget-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qfitswidget-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for qfitswidget-1.3.1-py3-none-any.whl |
Total release size: 60.2 kB
Release files / qfitswidget-1.3.1.tar.gz
| Download URL | qfitswidget-1.3.1.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24e8f5c5a2e3ed9ee18a29e8432d6209a1a1fe1012357de11f2142a88fe9123e
|
|
BLAKE2b-256 checksum How to use checksums |
ab7aae58caa588b3891e2df8b720843638f8ad9733dbc613fd8a000f6b664bd9
|
| 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.1-py3-none-any.whl
| Download URL | qfitswidget-1.3.1-py3-none-any.whl |
|---|---|
| Size | 33.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16663372c7152443a005af36980a8f6931c9088072be1ed4c1bd7810b33cb8c0
|
|
BLAKE2b-256 checksum How to use checksums |
e4789d261538f23f2bedcb2854a7c985cef6d04c47381cd4d18f7e1e80fc21ef
|
| 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.1
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.