Skip to main content

Read GRIB (GRIB1/GRIB2) weather and ocean data into napari using gribberish

Project description

napari-gribberish

License BSD-3 PyPI Python Version tests codecov napari hub npe2

Open GRIB (GRIB1 / GRIB2) weather and ocean forecast files in napari, powered by the fast Rust-based gribberish decoder.

HRRR 2 m temperature over the continental US

HRRR 2 m temperature over the continental US — the Rocky Mountains show up cold on the left.

Every variable in a file becomes an image layer, and any non-spatial dimensions (forecast time, vertical level, ensemble member, …) become interactive slider axes.

Features

  • 📂 Reader — drag-and-drop or File ▸ Open any .grib, .grib2, .grb, or .grb2 file. Each variable loads as its own layer with units and long name attached, and the horizontal grid mapped to layer scale/translate when the coordinates are regular.
  • 🎛️ Multi-dimensional navigation — time / level / member dimensions become napari sliders, so you can scrub or animate through a forecast.
  • 🧭 Smart colormaps — sequential fields use plasma; directional fields (wave/wind direction, 0–360°) get a cyclic colormap so 0° and 360° match.
  • 🧰 Variable selector widget — choose exactly which variables to load and how to display them (separate / blended / grid).
  • 🌐 Sample data — stream a slice of NOAA HRRR straight from the public AWS Open Data bucket, showcasing gribberish's remote + indexed reading.

Installation

pip install "napari-gribberish[all]"   # includes napari + Qt

If you already have napari installed:

pip install napari-gribberish

Latest development version:

pip install "git+https://github.com/ianhi/napari-gribberish.git"

Note: requires napari ≥ 0.8 and Python ≥ 3.12.

Usage

Opening a file

Drag a GRIB file onto the napari window, or use File ▸ Open. From Python:

import napari

viewer = napari.Viewer()
viewer.open("forecast.grib2", plugin="napari-gribberish")
napari.run()

To avoid stacking many opaque layers on top of each other, the reader loads every variable but reveals only the first — toggle the others with the 👁 icons in the layer list.

Multi-dimensional data

Files with extra dimensions (here ERA5 with forecast time × pressure level × ensemble member) expose one slider per non-spatial axis. Drag them, or press ▶ to animate.

ERA5 opened in napari with time, level and member sliders

Variable selector widget

Plugins ▸ GRIB variable selector opens a dock where you pick a file, select which variables to load, and choose a display mode:

  • separate — one layer per variable, only the first visible (best for unrelated fields)
  • blend — all selected variables visible with additive blending (overlay a few fields)
  • grid — all selected variables side by side for comparison

The GRIB variable selector dock widget

Grid mode is handy for comparing related fields at a glance — note the wave-direction panel (bottom-left) automatically uses a cyclic colormap:

Four wave variables compared side by side in grid mode

Sample data

File ▸ Open Sample ▸ Gribberish ▸ HRRR surface (remote) streams 2 m temperature and 10 m wind gust from the public NOAA HRRR archive on AWS (requires network access).

Reading GRIB without napari

The plugin is a thin layer over gribberish's xarray backend, so the same files open directly with:

import xarray as xr

ds = xr.open_dataset("forecast.grib2", engine="gribberish", collapse_groups=True)

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

uv run pytest          # run the test suite
uv run napari          # launch napari with the plugin installed

License

Distributed under the terms of the BSD-3 license, "napari-gribberish" is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari_gribberish-0.1.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_gribberish-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file napari_gribberish-0.1.0.tar.gz.

File metadata

  • Download URL: napari_gribberish-0.1.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for napari_gribberish-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f410af2df8e86e756f9e5a7e6109b7a91335d667c573595ceff30a7390cd7971
MD5 0c2b5a1e6868cc826369fedefe642668
BLAKE2b-256 4af8c3462569f63b8d2611e6bf1e89b827af698c7ceac68301ef00def4af3c85

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_gribberish-0.1.0.tar.gz:

Publisher: deploy.yml on ianhi/napari-gribberish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file napari_gribberish-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_gribberish-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a308ddeef0a976b6fcb42d6baa062f36f8ca8dea5ebb5c810f8fe63534eabdd
MD5 3b61401030508cb4c9746c6e4ab5367a
BLAKE2b-256 abfa71628920aa6ced3d41585edc2b62a0981197006916776054d92b2f619f23

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_gribberish-0.1.0-py3-none-any.whl:

Publisher: deploy.yml on ianhi/napari-gribberish

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page