xspharm


Namexspharm JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/senclimate/xspharm
Summaryxarray interface to spherical harmonic transform
upload_time2023-11-04 16:38:05
maintainer
docs_urlNone
authorSen Zhao
requires_python>=3.6
licenseBSD license
keywords xspharm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ===========================================================
 xspharm: Xarray Interface for Spherical Harmonic Transform 
===========================================================

.. image:: https://img.shields.io/pypi/v/xspharm.svg
    :target: https://pypi.python.org/pypi/xspharm
    :alt: PyPI Version

.. image:: https://readthedocs.org/projects/xspharm/badge/?version=latest
    :target: https://xspharm.readthedocs.io/en/latest/?badge=latest
    :alt: 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:

.. code-block:: console

    $ pip install xspharm

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


.. code-block:: python

    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
-------------

* **Documentation** available at https://xspharm.readthedocs.io.

`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.

.. _Jeff Whitaker: https://github.com/jswhit
.. _Andrew Dawson: https://github.com/ajdawson
.. _pyspharm: https://github.com/jswhit/pyspharm
.. _windspharm: https://github.com/ajdawson/windspharm


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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/senclimate/xspharm",
    "name": "xspharm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "xspharm",
    "author": "Sen Zhao",
    "author_email": "zhaos2016@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/48/d9/7fb68072d5539ade6f70cd957800996f0756e0789ca51c9f9c21488aba5f/xspharm-0.1.2.tar.gz",
    "platform": null,
    "description": "===========================================================\n xspharm: Xarray Interface for Spherical Harmonic Transform \n===========================================================\n\n.. image:: https://img.shields.io/pypi/v/xspharm.svg\n    :target: https://pypi.python.org/pypi/xspharm\n    :alt: PyPI Version\n\n.. image:: https://readthedocs.org/projects/xspharm/badge/?version=latest\n    :target: https://xspharm.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\nOverview\n--------\n\n`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.\n\n\nQuick Start\n-----------\n\nTo install `xspharm`, run this command in your terminal:\n\n.. code-block:: console\n\n    $ pip install xspharm\n\nThis is the preferred method to install xspharm, as it will always install the most recent stable release.\n\n\n.. code-block:: python\n\n    from xspharm import xspharm\n    xsp = xspharm(grid_ds, grid_type='regular')\n\n    # convert u anv v to streamfunction and velocity potential\n    sfvp_ds = xsp.uv2sfvp(u_ds, v_ds, ntrunc=24)\n\n    # tri_truncate the fields (can be xarray DataArray or Dataset in same spatial coordinates with grid_ds)\n    trunc_ds = xsp.truncate(field_ds, ntrunc=42)\n\n\nDocumentation\n-------------\n\n* **Documentation** available at https://xspharm.readthedocs.io.\n\n`xspharm` provides a suite of methods to manipulate and transform geospatial datasets:\n\n- `truncate`: Reduces the resolution of a data variable or an entire dataset to a specified spherical harmonic wavenumber.\n- `exp_taper`: Applies tapering to mitigate the Gibbs phenomenon in spherical harmonic coefficients.\n- `uv2sfvp`: Transforms zonal (`u`) and meridional (`v`) wind components into streamfunction (`sf`) and velocity potential (`vp`).\n- `uv2vordiv`: Converts zonal (`u`) and meridional (`v`) wind components to vorticity and divergence fields.\n- `uv2absvor`: Changes zonal (`u`) and meridional (`v`) wind components to absolute vorticity.\n- `sf2uv`: Derives rotational wind components from a given streamfunction.\n- `vp2uv`: Obtains divergent wind components from velocity potential.\n- `sfvp2uv`: Integrates streamfunction and velocity potential to produce zonal (`u`) and meridional (`v`) wind components.\n\nAcknowledgments\n---------------\n\nSpecial 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.\n\n.. _Jeff Whitaker: https://github.com/jswhit\n.. _Andrew Dawson: https://github.com/ajdawson\n.. _pyspharm: https://github.com/jswhit/pyspharm\n.. _windspharm: https://github.com/ajdawson/windspharm\n\n\nLicense\n-------\nDistributed under the BSD License.\n\n\n=======\nHistory\n=======\n\n0.1.2 (2023-11-04)\n------------------\n\n* Fix bugs and documentation\n\n\n0.1.1 (2023-11-03)\n------------------\n\n* Update documentation\n\n\n0.1.0 (2023-11-02)\n------------------\n\n* First release on PyPI.\n",
    "bugtrack_url": null,
    "license": "BSD license",
    "summary": "xarray interface to spherical harmonic transform",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/senclimate/xspharm"
    },
    "split_keywords": [
        "xspharm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f23577b85d8b37b02baf48fb172910cc8ce655d1082844e0dcedc9c8e2ae944",
                "md5": "8ccf14f66f2b204cf414bd2dd54e3211",
                "sha256": "072eac437874e6e716f119d25249ad143de545d1b3ba0eea30f95879d55bb117"
            },
            "downloads": -1,
            "filename": "xspharm-0.1.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ccf14f66f2b204cf414bd2dd54e3211",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 6817,
            "upload_time": "2023-11-04T16:38:04",
            "upload_time_iso_8601": "2023-11-04T16:38:04.444268Z",
            "url": "https://files.pythonhosted.org/packages/1f/23/577b85d8b37b02baf48fb172910cc8ce655d1082844e0dcedc9c8e2ae944/xspharm-0.1.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48d97fb68072d5539ade6f70cd957800996f0756e0789ca51c9f9c21488aba5f",
                "md5": "60997bbbe060f8622c8a88b81f982eb4",
                "sha256": "cda37ff948b839014a72dd1b042d2efc58f6e58759b6c09ae995fd4bee076044"
            },
            "downloads": -1,
            "filename": "xspharm-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "60997bbbe060f8622c8a88b81f982eb4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 13240,
            "upload_time": "2023-11-04T16:38:05",
            "upload_time_iso_8601": "2023-11-04T16:38:05.767356Z",
            "url": "https://files.pythonhosted.org/packages/48/d9/7fb68072d5539ade6f70cd957800996f0756e0789ca51c9f9c21488aba5f/xspharm-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-04 16:38:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "senclimate",
    "github_project": "xspharm",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "xspharm"
}
        
Elapsed time: 0.25682s