No project description provided
Project description
healpix-plot
Fast, practical static plots of HEALPix data with matplotlib and cartopy — with ellipsoidal (WGS84) support for geoscience workflows.
Overview
healpix-plotting prioritises getting a usable figure quickly over perfectly accurate cell-geometry rendering. It rasterises HEALPix data via nearest-neighbour resampling onto a regular lon/lat grid and renders the result with Cartopy's imshow.
Unlike astronomy-focused HEALPix tools, this library is built with Earth observation and geoscience in mind: the underlying coordinate operations are provided by healpix-geo, which supports geodetically correct reference ellipsoids such as WGS84.
The library is well suited for:
- Exploratory analysis and quality control of EO / climate data
- Debugging and sanity checks
- Quick snapshots for reports and discussions
It is not intended as a true boundary-polygon renderer.
Dependencies
| Package | Role |
|---|---|
| healpix-geo | Core HEALPix ↔ lon/lat conversions, ellipsoid support |
| cartopy | Map projections and rendering |
| matplotlib | Figure/axes backend |
| numpy | Array operations |
| numpy-groupies | Aggregation during duplicate-cell-id deduplication |
| affine | Affine transform support for AffineSamplingGrid |
| scipy | Reserved for future bilinear interpolation |
Installation
pip install healpix-plotting
How it works
- Build a target sampling grid — a regular lon/lat grid inferred from the data, defined by a bounding box, or specified via an affine transform.
- Resample — each sampling point is mapped to a HEALPix cell id and filled by nearest-neighbour lookup (with optional aggregation for duplicate ids).
- Render — the resulting raster is drawn on a Cartopy axis with
imshow(..., transform=PlateCarree()).
Because the library rasterises via nearest-neighbour resampling, it does not attempt exact polygon boundary filling.
Ellipsoidal support
Standard HEALPix was originally defined on the unit sphere. For geoscience applications — such as Earth observation, numerical weather prediction, or climate modelling — coordinates are commonly expressed in geodetic lon/lat on a reference ellipsoid (most often WGS84).
healpix-plotting delegates coordinate conversions to healpix-geo,
which implements ellipsoidal HEALPix conversions. Passing ellipsoid="WGS84" to HealpixGrid
propagates this choice through all internal operations.
For a full explanation of how ellipsoidal HEALPix works, see the healpix-geo ellipsoids tutorial.
Things to keep in mind
HEALPix is a spherical tessellation. Depending on your use case you may need to consider:
- True cell boundaries — cells are not lon/lat rectangles; boundaries are curved on the sphere.
- Projection effects — any map projection changes apparent cell geometry.
- Resolution and aliasing — the target sampling-grid resolution determines sharpness and artifact level.
- Dateline and polar behaviour — extent wrapping and polar distortion can introduce discontinuities.
- Sphere vs. ellipsoid — for precise geoscience work, prefer
ellipsoid="WGS84"over the default"sphere".
Limitations
- Rendering is raster-based; exact HEALPix cell boundaries are not drawn.
- Output quality depends on the sampling-grid resolution (speed vs. aliasing trade-off).
"bilinear"interpolation is currently not implemented (raisesNotImplementedError).- The helper pattern
healpix_grid.operations.healpix_to_lonlat(cell_ids, **healpix_grid.as_keyword_params())does not work forindexing_scheme="zuniq"— see the caveat in HealpixGrid.
Alternatives
| Library | Best for |
|---|---|
| healpy | Conventional HEALPix map visualisation; mollview and friends. Sphere only. |
| earthkit-plots | Publication-quality figures in the ECMWF / earthkit stack. |
| xdggs | Analysis/selection workflows and polygon-based rendering with true cell boundaries. |
Choosing a tool
Need a quick geoscience plot (EO, NWP, climate)? → healpix-plotting ✓ (WGS84 support)
Working in the ECMWF/earthkit ecosystem? → earthkit-plots ✓
Need exact cell boundaries / polygon operations? → xdggs ✓
Standard healpy full-sky (astronomy) workflow? → healpy ✓
Implementation notes
Nearest-neighbour resampling
For each sampling-grid point, the corresponding HEALPix cell id is computed. Ids not present
in the source data are masked; the remaining values are placed into the raster using
searchsorted-based indexing.
Aggregation
Before resampling, duplicate cell_ids are collapsed with numpy-groupies using the
function specified by agg (default: "mean"). The sorted unique ids are then used
as the lookup table for the raster fill.
Cartopy rendering
Plotting uses imshow with transform=ccrs.PlateCarree() and interpolation="nearest".
For non-global subsets, the extent is set before plotting to obtain a smoother result
with Cartopy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file healpix_plot-2026.5.1.tar.gz.
File metadata
- Download URL: healpix_plot-2026.5.1.tar.gz
- Upload date:
- Size: 38.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
761935b6ab6fb2d06266febb3b5392032ef3538900568dc54abcbca36441457b
|
|
| MD5 |
b6937d367df13b576331148e0bccc9e5
|
|
| BLAKE2b-256 |
9d29bb8fdfd4d4e980f07fcbc608d8cd7933d082f0a5a08704b39fe861c717f2
|
Provenance
The following attestation bundles were made for healpix_plot-2026.5.1.tar.gz:
Publisher:
pypipublish.yml on EOPF-DGGS/healpix-plot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
healpix_plot-2026.5.1.tar.gz -
Subject digest:
761935b6ab6fb2d06266febb3b5392032ef3538900568dc54abcbca36441457b - Sigstore transparency entry: 1458674252
- Sigstore integration time:
-
Permalink:
EOPF-DGGS/healpix-plot@823d4ec07b310aa731a505cf8b82970caf5594f1 -
Branch / Tag:
refs/tags/v2026.5.1 - Owner: https://github.com/EOPF-DGGS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypipublish.yml@823d4ec07b310aa731a505cf8b82970caf5594f1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file healpix_plot-2026.5.1-py3-none-any.whl.
File metadata
- Download URL: healpix_plot-2026.5.1-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d620ebb5ac3cf3cbf694982b42d12bcc712696b58fd654d03b056b4b11907b4
|
|
| MD5 |
405db87dd08033384f4f94572f3dc358
|
|
| BLAKE2b-256 |
58082cf7f13c3e73af23722b8f4107a6bc116656bc502ddea8667ee854c801d7
|
Provenance
The following attestation bundles were made for healpix_plot-2026.5.1-py3-none-any.whl:
Publisher:
pypipublish.yml on EOPF-DGGS/healpix-plot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
healpix_plot-2026.5.1-py3-none-any.whl -
Subject digest:
2d620ebb5ac3cf3cbf694982b42d12bcc712696b58fd654d03b056b4b11907b4 - Sigstore transparency entry: 1458674313
- Sigstore integration time:
-
Permalink:
EOPF-DGGS/healpix-plot@823d4ec07b310aa731a505cf8b82970caf5594f1 -
Branch / Tag:
refs/tags/v2026.5.1 - Owner: https://github.com/EOPF-DGGS
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypipublish.yml@823d4ec07b310aa731a505cf8b82970caf5594f1 -
Trigger Event:
release
-
Statement type: