You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-6Lines changed: 21 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,37 @@
5
5
6
6
This extension adds functionality to work with Spherical Harmonics to [Xarray](https://github.com/pydata/xarray).
7
7
8
-
## Features and functionality (in progress)
8
+
9
+
## Features and functionality
9
10
* Gravity functionals: (convert from Stokes coefficients to various gravity functionals, such as equivalent water heights, geoid changes, etc.)
10
11
* Filter (e.g. Gaussian or anisotropic filter applied in the spectral domain)
11
-
* The use of Xarraylike operations allow for applying functionality to multi-dimensional datasets
12
-
12
+
* The use of Xarray-like operations allow for applying functionality to multi-dimensional datasets
13
+
* A spectral sea level equation solver
13
14
14
15
## Getting started
15
-
The tutorials in the [documentation](https://shxarray.wobbly.earth/stable/tutorial.html)will gradually epxand and provide Jupyter notebook workflows to start with.
16
+
The tutorials in the [documentation](https://shxarray.wobbly.earth/stable/tutorial.html)provide Jupyter Notebooks with examples of how to make use of the module. The notebooks can also be found on the [github repository](https://github.com/ITC-Water-Resources/shxarray/tree/main/docs/source/notebooks).
16
17
18
+
The functionality of shxarray becomes available when importing the module together with Xarray:
19
+
20
+
```
21
+
import shxarray
22
+
import xarray as xr
23
+
```
24
+
after which the shxarray accessor becomes available for use, e.g.:
25
+
```
26
+
nmax=20
27
+
nmin=2
28
+
dazeros=xr.DataArray.sh.ones(nmax=nmax,nmin=nmin)
29
+
```
17
30
18
31
## Installation
19
32
You can install this package from PyPi using:
20
33
```
21
34
pip install shxarray
22
35
```
23
36
37
+
## Backends
38
+
Shxarray comes with a default **shlib** backend written in C++ and Cython. In addition, a very fast 'shtns' backend can be used when [SHTns](https://nschaeff.bitbucket.io/shtns/) is installed. The backends can be specified in enabled routines as the options: `engine='shlib'` or `engine='shtns'`.
24
39
25
40
## Development Installation
26
41
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](https://cython.readthedocs.io/en/latest/) generated code to speed up spherical harmonic synthesis and analysis.
@@ -41,15 +56,15 @@ will be much faster than using
41
56
```pip install -e .```
42
57
43
58
44
-
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 can create a symbolic link in the Python part of the library e.g. :
59
+
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. :
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 install.
67
+
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.
- Add logo, favicon and change documentation theme
15
+
- Add `SHtns <https://nschaeff.bitbucket.io/shtns/>`_ as a (very fast) computational backend for analysis and synthesis operations of spherical harmonic data.
16
+
- Fix code such that it can be compiled on Windows with MSVC see: `Installation fails on Windows <https://github.com/ITC-Water-Resources/shxarray/issues/3>`_
17
+
- Add Xarray reading backend to read SINEX files
18
+
- Add option to decorate xarray with user defined attributes which can be saved to file
19
+
- Add a Spectral Sea Level Equation solver
20
+
21
+
22
+
Version <= 1.2.0
23
+
----------------
24
+
Consult the `commit messages <https://github.com/ITC-Water-Resources/shxarray/commits/v1.2.0>`_ for information on earlier releases
Users interested in developing can install the latest version from `github <https://github.com/ITC-Water-Resources/shxarray/tree/main>`_. Cython is needed in case the binary extension is being developed, and users can consult the dedicated instructions on the github repository.
8
+
9
+
10
+
11
+
12
+
Testing suite with pytest
13
+
-------------------------
14
+
From the repositories root directory, the entire test suite can be run with the following command:
15
+
16
+
.. code-block:: console
17
+
18
+
python -m pytest tests/
19
+
20
+
21
+
Coding style
22
+
------------
23
+
Code can be supplied with `numpy docstrings <https://www.sphinx-doc.org/en/master/usage/extensions/example_numpy.html>`_ so they can be parsed into this documentation.
0 commit comments