https://github.com/astro-informatics/sleplet
Slepian Scale-Discretised Wavelets in Python
https://github.com/astro-informatics/sleplet
hacktoberfest manifolds python slepian-functions sphere wavelets
Last synced: 7 months ago
JSON representation
Slepian Scale-Discretised Wavelets in Python
- Host: GitHub
- URL: https://github.com/astro-informatics/sleplet
- Owner: astro-informatics
- License: bsd-3-clause
- Created: 2020-10-21T14:33:32.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-03T08:23:49.000Z (about 1 year ago)
- Last Synced: 2024-12-06T21:44:01.190Z (about 1 year ago)
- Topics: hacktoberfest, manifolds, python, slepian-functions, sphere, wavelets
- Language: Python
- Homepage: https://pypi.org/project/sleplet
- Size: 29 MB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
# SLEPLET
[](https://pypi.org/project/sleplet)
[](https://doi.org/10.5281/zenodo.7268074)
[](https://astro-informatics.github.io/sleplet)
[](https://github.com/astro-informatics/sleplet?tab=BSD-3-Clause-1-ov-file#readme)
[](https://www.python.org)
[](https://www.repostatus.org/#active)
[](https://github.com/astro-informatics/sleplet/actions/workflows/test.yaml)
[](https://coveralls.io/github/astro-informatics/sleplet?branch=main)
[](https://www.codefactor.io/repository/github/astro-informatics/sleplet)
[](https://joss.theoj.org/papers/55d9cf16a27bf2d3141f0f66c676b7f2)
[](https://github.com/pyOpenSci/software-submission/issues/149)
[](https://github.com/astro-informatics/sleplet#citing)
[](https://github.com/pre-commit/pre-commit)
[](https://docs.renovatebot.com)
`SLEPLET` is a Python package for the construction of Slepian wavelets in the
spherical and manifold (via meshes) settings. The API of `SLEPLET` has been
designed in an object-orientated manner and is easily extendable. Upon
installation, `SLEPLET` comes with two command line interfaces - `sphere` and
`mesh` - which allows one to easily generate plots on the sphere and a set of
meshes using `plotly`.
To read more about Slepian wavelets please see the following publications
[](https://dx.doi.org/10.1109/LSP.2021.3050961)
[](https://dx.doi.org/10.1109/TSP.2022.3233309)
[](https://doi.org/10.48550/arXiv.2302.06006)
[](https://paddyroddy.github.io/thesis)
## Installation
The recommended way to install `SLEPLET` is via
[pip](https://pypi.org/project/pip)
```sh
pip install sleplet
```
To install the latest development version of `SLEPLET` clone this repository and
run
```sh
pip install -e .
```
This will install two scripts `sphere` and `mesh` which can be used to generate
the figures in
[the associated papers](https://astro-informatics.github.io/sleplet#paper-figures).
### Supported Platforms
`SLEPLET` has been tested with
[](https://www.python.org).
Windows is not currently supported as `SLEPLET` relies on
[pyssht](https://pypi.org/project/pyssht) and
[pys2let](https://pypi.org/project/pys2let) which do not work on Windows. These
may be replaced with [s2fft](https://github.com/astro-informatics/s2fft) and
[s2wav](https://github.com/astro-informatics/s2wav) in the future when they are
available on [PyPI](https://pypi.org).
## Example Usage
`SLEPLET` may be interacted with via the API or the CLIs.
### API Usage
The following demonstrates the first wavelet (ignoring the scaling function) of
the South America region on the sphere.
```python
import sleplet
B, J, J_MIN, L = 3, 0, 2, 128
region = sleplet.slepian.Region(mask_name="south_america")
f = sleplet.functions.SlepianWavelets(L, region=region, B=B, j_min=J_MIN, j=J)
f_sphere = sleplet.slepian_methods.slepian_inverse(f.coefficients, f.L, f.slepian)
sleplet.plotting.PlotSphere(
f_sphere,
f.L,
f"slepian_wavelets_south_america_{B}B_{J_MIN}jmin_{J_MIN+J}j_L{L}",
normalise=False,
region=f.region,
).execute()
```

### CLI Usage
The demonstrates the first wavelet (ignoring the scaling function) of the head
region of a Homer Simpson mesh for a per-vertex normals field.
```sh
mesh homer -e 3 2 0 -m slepian_wavelet_coefficients -u -z
```

## Documentation
See here for the [documentation](https://astro-informatics.github.io/sleplet).
This includes demonstrations of the figures from the associated papers along
with the API documentation. Further examples are included in the
[examples folder](https://github.com/astro-informatics/sleplet/tree/main/examples).
## Community Guidelines
We'd love any contributions you may have, please see the
[contributing guidelines](https://github.com/astro-informatics/sleplet/blob/main/CONTRIBUTING.md).
## Citing
If you use `SLEPLET` in your research, please cite the paper.
```bibtex
@article{Roddy2023,
title = {{SLEPLET: Slepian Scale-Discretised Wavelets in Python}},
author = {Roddy, Patrick J.},
year = 2023,
journal = {Journal of Open Source Software},
volume = 8,
number = 84,
pages = 5221,
doi = {10.21105/joss.05221},
}
```
Please also cite [S2LET](https://doi.org/10.1051/0004-6361/201220729) upon which
`SLEPLET` is built, along with [SSHT](https://doi.org/10.1109/TSP.2011.2166394)
in the spherical setting or [libigl](https://doi.org/10.1145/3134472.3134497) in
the mesh setting.