Skip to main content

xarray interface to spherical harmonic transform

Project description

xspharm: Xarray Interface for Spherical Harmonic Transform

PyPI Version Documentation Status

Overview

xspharm is an xarray-compatible library that facilitates spherical harmonic transforms. It leverages the computational efficiency of pyspharm and the convenience of xarray data structures to provide an intuitive interface for processing geospatial data on a spherical domain.

Quick Start

To install xspharm, run this command in your terminal:

$ pip install xspharm

This is the preferred method to install xspharm, as it will always install the most recent stable release.

from xspharm import xspharm
xsp = xspharm(grid_ds, grid_type='regular')

# convert u anv v to streamfunction and velocity potential
sfvp_ds = xsp.uv2sfvp(u_ds, v_ds, ntrunc=24)

# tri_truncate the fields (can be xarray DataArray or Dataset in same spatial coordinates with grid_ds)
trunc_ds = xsp.truncate(field_ds, ntrunc=42)

Documentation

xspharm provides a suite of methods to manipulate and transform geospatial datasets:

  • truncate: Reduces the resolution of a data variable or an entire dataset to a specified spherical harmonic wavenumber.

  • exp_taper: Applies tapering to mitigate the Gibbs phenomenon in spherical harmonic coefficients.

  • uv2sfvp: Transforms zonal (u) and meridional (v) wind components into streamfunction (sf) and velocity potential (vp).

  • uv2vordiv: Converts zonal (u) and meridional (v) wind components to vorticity and divergence fields.

  • uv2absvor: Changes zonal (u) and meridional (v) wind components to absolute vorticity.

  • sf2uv: Derives rotational wind components from a given streamfunction.

  • vp2uv: Obtains divergent wind components from velocity potential.

  • sfvp2uv: Integrates streamfunction and velocity potential to produce zonal (u) and meridional (v) wind components.

Acknowledgments

Special thanks to Jeff Whitaker for sharing the pyspharm library, which forms the foundation of this package’s capabilities; and to Andrew Dawson for inspiring with the windspharm library.

License

Distributed under the BSD License.

History

0.1.2 (2023-11-04)

  • Fix bugs and documentation

0.1.1 (2023-11-03)

  • Update documentation

0.1.0 (2023-11-02)

  • First release on PyPI.

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

xspharm-0.1.2.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

xspharm-0.1.2-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file xspharm-0.1.2.tar.gz.

File metadata

  • Download URL: xspharm-0.1.2.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for xspharm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 cda37ff948b839014a72dd1b042d2efc58f6e58759b6c09ae995fd4bee076044
MD5 60997bbbe060f8622c8a88b81f982eb4
BLAKE2b-256 48d97fb68072d5539ade6f70cd957800996f0756e0789ca51c9f9c21488aba5f

See more details on using hashes here.

File details

Details for the file xspharm-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: xspharm-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for xspharm-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 072eac437874e6e716f119d25249ad143de545d1b3ba0eea30f95879d55bb117
MD5 8ccf14f66f2b204cf414bd2dd54e3211
BLAKE2b-256 1f23577b85d8b37b02baf48fb172910cc8ce655d1082844e0dcedc9c8e2ae944

See more details on using hashes here.

Supported by

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