Skip to main content

spharmgrid

CI Documentation Status codecov PyPI version PyPI Python Version Conda Version GitHub License DOI

Spherical harmonic tools for filtering, regridding, and kinematics in atmospheric science with Xarray.

spharmgrid (spherical harmonic gridding) implements spherical harmonic filtering, regridding, differential operators, and atmospheric kinematics for global Xarray fields. It computes relative vorticity, divergence, streamfunction, velocity potential, Helmholtz decomposition, and inverse wind transforms. DUCC performs the numerical spherical harmonic transforms.

Supported grids are full rectangular Gauss–Legendre (GL) and Clenshaw–Curtis (CC) grids.

Install

Install with either pip, uv, or conda:

pip install spharmgrid
uv add spharmgrid
conda install -c conda-forge spharmgrid

Optional groups are:

  • spharmgrid[dask] — Dask-backed lazy execution;
  • spharmgrid[cf] — optional cf-xarray coordinate discovery;
  • spharmgrid[cli] — command-line NetCDF, Zarr, and GRIB I/O.

Install spharmgrid[cli,dask] to use the transforming CLI commands.

For a standalone command-line installation:

uv tool install "spharmgrid[cli,dask]"

For a project environment, install the CLI and Dask extras with either:

uv add "spharmgrid[cli,dask]"
pip install "spharmgrid[cli,dask]"

Quick start

Importing spharmgrid registers the .sg accessor on Xarray objects. This example applies a T6–42 spectral filter to a DataArray:

import xarray as xr
import spharmgrid

field = xr.open_dataarray("msl.nc")
filtered = field.sg.filter("T6-42")

See the Quick start for regridding, atmospheric wind diagnostics, direct-function equivalents, and further examples.

Documentation

The optional CLI reads NetCDF, Zarr, and GRIB and writes NetCDF and Zarr. See the CLI documentation for installation and usage.

See the full documentation for grid requirements, coordinate handling, CF metadata, atmospheric kinematics, inverse transforms, zero-mode conventions, and command-line use.

Citation

If you use spharmgrid in research, please cite the software release DOI: 10.5281/zenodo.22559210. Citation metadata are also provided in CITATION.cff.

References

See the documentation References for the scientific literature and software cited by spharmgrid.

License

spharmgrid is distributed under the BSD 3-Clause License.

Download files

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

Source Distribution

spharmgrid-0.1.3.tar.gz (166.9 kB view details)

Uploaded Source

Built Distribution

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

spharmgrid-0.1.3-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file spharmgrid-0.1.3.tar.gz.

File metadata

  • Download URL: spharmgrid-0.1.3.tar.gz
  • Upload date:
  • Size: 166.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spharmgrid-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c1a1b6224a43fb83ea7e9778d9eea4e9c717aef854d8a1cab1e735e72494fb4a
MD5 a872457b23997ee693b09a72a9d1a768
BLAKE2b-256 a53bce84d4a13bf106d6ed7b1a209b91374b768cbf53dda9c2c6db70c60e5c17

See more details on using hashes here.

Provenance

The following attestation bundles were made for spharmgrid-0.1.3.tar.gz:

Publisher: python-publish.yml on mwyau/spharmgrid

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

File details

Details for the file spharmgrid-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: spharmgrid-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for spharmgrid-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3942557ce33c963a0d81100727de97d85a193ea2ec19cf8ec9ff90592c951c03
MD5 898fa8ea3484f4dad909e5490252443e
BLAKE2b-256 391e3b17500c064f0e5dbb153bd6e040655dfc18edd0264d983167b0a687fefe

See more details on using hashes here.

Provenance

The following attestation bundles were made for spharmgrid-0.1.3-py3-none-any.whl:

Publisher: python-publish.yml on mwyau/spharmgrid

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

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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