spharmgrid
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]— optionalcf-xarraycoordinate 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1a1b6224a43fb83ea7e9778d9eea4e9c717aef854d8a1cab1e735e72494fb4a
|
|
| MD5 |
a872457b23997ee693b09a72a9d1a768
|
|
| BLAKE2b-256 |
a53bce84d4a13bf106d6ed7b1a209b91374b768cbf53dda9c2c6db70c60e5c17
|
Provenance
The following attestation bundles were made for spharmgrid-0.1.3.tar.gz:
Publisher:
python-publish.yml on mwyau/spharmgrid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spharmgrid-0.1.3.tar.gz -
Subject digest:
c1a1b6224a43fb83ea7e9778d9eea4e9c717aef854d8a1cab1e735e72494fb4a - Sigstore transparency entry: 2824836594
- Sigstore integration time:
-
Permalink:
mwyau/spharmgrid@f8b65f3fb72585f2babf48d23aff627a16f558cc -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/mwyau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f8b65f3fb72585f2babf48d23aff627a16f558cc -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3942557ce33c963a0d81100727de97d85a193ea2ec19cf8ec9ff90592c951c03
|
|
| MD5 |
898fa8ea3484f4dad909e5490252443e
|
|
| BLAKE2b-256 |
391e3b17500c064f0e5dbb153bd6e040655dfc18edd0264d983167b0a687fefe
|
Provenance
The following attestation bundles were made for spharmgrid-0.1.3-py3-none-any.whl:
Publisher:
python-publish.yml on mwyau/spharmgrid
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spharmgrid-0.1.3-py3-none-any.whl -
Subject digest:
3942557ce33c963a0d81100727de97d85a193ea2ec19cf8ec9ff90592c951c03 - Sigstore transparency entry: 2824836665
- Sigstore integration time:
-
Permalink:
mwyau/spharmgrid@f8b65f3fb72585f2babf48d23aff627a16f558cc -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/mwyau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f8b65f3fb72585f2babf48d23aff627a16f558cc -
Trigger Event:
push
-
Statement type: