shxarray
Extension to xarray providing functionality to work with spherical harmonic datasets
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.9%) to scientific vocabulary
Keywords
Repository
Extension to xarray providing functionality to work with spherical harmonic datasets
Basic Info
- Host: GitHub
- Owner: ITC-Water-Resources
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://shxarray.wobbly.earth
- Size: 32.3 MB
Statistics
- Stars: 11
- Watchers: 5
- Forks: 2
- Open Issues: 1
- Releases: 12
Topics
Metadata Files
README.md
Xarray Extension for working with spherical harmonic data
This extension adds functionality to work with Spherical Harmonics to Xarray.
Features and functionality
- Gravity functionals: (convert from Stokes coefficients to various gravity functionals, such as equivalent water heights, geoid changes, etc.)
- Filter (e.g. Gaussian or anisotropic filter applied in the spectral domain)
- The use of Xarray-like operations allow for applying functionality to multi-dimensional datasets
- A spectral sea level equation solver
Getting started
The tutorials in the documentation provide Jupyter Notebooks with examples of how to make use of the module. The notebooks can also be found on the github repository.
The functionality of shxarray becomes available when importing the module together with Xarray:
import shxarray
import xarray as xr
after which the shxarray accessor becomes available for use, e.g.:
nmax=20
nmin=2
dazeros=xr.DataArray.sh.ones(nmax=nmax,nmin=nmin)
Installation
You can install this package from PyPi using:
pip install shxarray
Backends
Shxarray comes with a default shlib backend written in C++ and Cython. In addition, a very fast 'shtns' backend can be used when SHTns is installed. The backends can be specified in enabled routines as the options: engine='shlib' or engine='shtns'.
Development Installation
If you want to help in the development of this package, it's best to clone the repository to allow for modifications and pull requests. The extension makes use of Cython generated code to speed up spherical harmonic synthesis and analysis.
- Create your own virtual environment with
venvor Anaconda (Optional but recommended, when a user installation is desired) - Clone this repository
git clone https://github.com/ITC-Water-Resources/shxarray.git - Change to the repository directory
cd shaxarray - Set the environment variable
export USE_CYTHON=1(Optional and only in the case Cython code is being developed or needs to be regenerated) - Install using pip
pip install .or usepip install -e .for an editable install
Cython build tip on an editable install
From the repository root directory, regenerating the shared library running
python ./setup.py build_ext
will be much faster than using
pip install -e .
This will build the shared library in for example ./build/lib.linux-x86_64-cpython-3xx/shxarray/shlib.cpython-3xx-x86_64-linux-gnu.so. To make sure changes are picked up in your editable install you should create a symbolic link in the Python part of the library e.g. :
cd src/shxarray/
ln -sf ../../build/lib.linux-x86_64-cpython-311/shxarray/shlib.cpython-311-x86_64-linux-gnu.so
Numpy version issues
The provided c++ files are cythonized against numpy > 2. When building against older numpy versions (<2), the cpp files are re-cythonized upon install, this requires a working cython installation.
Contributing
This repository is under development and contributions and feedback is welcome.
Contributors
- Main developer: Roelof Rietbroek (r.rietbroek@utwente.nl)
- Kiana Karimi
Owner
- Name: Water Resources Department of the Faculty of Geo-Information Science and Earth Observation
- Login: ITC-Water-Resources
- Kind: organization
- Location: Netherlands
- Website: https://www.itc.nl/about-itc/organization/scientific-departments/water-resources
- Repositories: 2
- Profile: https://github.com/ITC-Water-Resources
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Rietbroek" given-names: "Roelof" orcid: "https://orcid.org/0000-0001-5276-5943" - family-names: "Karimi" given-names: "Sedigheh" title: "SHxarray: an extension to xarray providing functionality to work with spherical harmonic datasets" version: 1.3.2 doi: 10.5281/zenodo.15236539 date-released: 2025-04-17 url: "https://github.com/ITC-Water-Resources/shxarray"
GitHub Events
Total
- Create event: 9
- Release event: 3
- Issues event: 6
- Watch event: 10
- Delete event: 1
- Issue comment event: 13
- Push event: 37
- Pull request review event: 1
- Pull request event: 9
- Fork event: 2
Last Year
- Create event: 9
- Release event: 3
- Issues event: 6
- Watch event: 10
- Delete event: 1
- Issue comment event: 13
- Push event: 37
- Pull request review event: 1
- Pull request event: 9
- Fork event: 2
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Roelof Rietbroek | r****k@u****l | 99 |
| SedighehKarimi | s****4@g****m | 3 |
| Roelof Rietbroek | r****f@o****h | 1 |
| Kiana Karimi | k****s@l****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 6
- Total pull requests: 6
- Average time to close issues: 14 days
- Average time to close pull requests: 1 day
- Total issue authors: 3
- Total pull request authors: 1
- Average comments per issue: 1.5
- Average comments per pull request: 0.67
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 5
- Pull requests: 6
- Average time to close issues: 19 days
- Average time to close pull requests: 1 day
- Issue authors: 3
- Pull request authors: 1
- Average comments per issue: 1.4
- Average comments per pull request: 0.67
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- strawpants (3)
- SedighehKarimi (2)
- lqgentner (1)
Pull Request Authors
- SedighehKarimi (10)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 28 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 13
- Total maintainers: 1
pypi.org: shxarray
Spherical harmonic extension for Xarray
- Homepage: https://github.com/ITC-Water-Resources/shxarray
- Documentation: https://shxarray.readthedocs.io/
- License: Apache Software License
-
Latest release: 1.4.0
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- sphinx ==7.1.2
- sphinx-rtd-theme ==1.3.0rc1
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
- pandas >=2.2.0
- pyaml >=23.9.0
- xarray >=2023.1.0