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
Unit tests can then be executed to ensure the installation was successful by first installing the test requirements and then running pytest
96
+
A `pytest` test suite for the package is included in the `tests` directory.
97
+
To install the test dependencies, clone the repository and install the package (in [editable mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html))
98
+
with the extra test dependencies by running from the root of the repository
Documentation for the released version is available [here](https://astro-informatics.github.io/s2fft/). To build the documentation locally run
104
+
To run the tests, run from the root of the repository
108
105
109
-
```bash
110
-
pip install -r requirements/requirements-docs.txt
106
+
```bash
107
+
pytest
108
+
```
109
+
110
+
## Documentation 📖
111
+
112
+
Documentation for the released version is available [here](https://astro-informatics.github.io/s2fft/).
113
+
To install the documentation dependencies, clone the repository and install the package (in [editable mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html))
114
+
with the extra documentation dependencies by running from the root of the repository
115
+
116
+
```bash
117
+
pip install -e ".[docs]"
118
+
```
119
+
120
+
To build the documentation, run from the root of the repository
121
+
122
+
```bash
111
123
cd docs
112
124
make html
113
125
open _build/html/index.html
114
126
```
115
127
116
-
> [!NOTE]
117
-
> For plotting functionality which can be found throughout our various notebooks, one must install the requirements which can be found in `requirements/requirements-plotting.txt`.
128
+
## Notebooks 📓
129
+
130
+
A series of tutorial notebooks are included in the `notebooks` directory
131
+
and rendered [in the documentation](https://astro-informatics.github.io/s2fft/tutorials/index.html).
132
+
133
+
To install the dependencies required to run the notebooks locally, clone the repository and install the package (in [editable mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html))
134
+
with the extra documentation and plotting dependencies by running from the root of the repository
135
+
136
+
```bash
137
+
pip install -e ".[docs,plotting]"
138
+
```
139
+
140
+
To run the notebooks in Jupyter Lab, run from the root of the repository
141
+
142
+
```bash
143
+
jupyter lab
144
+
```
118
145
119
146
## Usage 🚀
120
147
121
148
To import and use `S2FFT` is as simple follows:
122
149
123
150
For a signal on the sphere
124
151
125
-
```python
152
+
```python
153
+
import s2fft
154
+
155
+
# Define sampled signal to transform and harmonic bandlimit
156
+
f =...
157
+
L =...
126
158
# Compute harmonic coefficients
127
-
flm = s2fft.forward_jax(f, L)
159
+
flm = s2fft.forward(f, L, method="jax")
128
160
# Map back to pixel-space signal
129
-
f = s2fft.inverse_jax(flm, L)
161
+
f = s2fft.inverse(flm, L, method="jax")
130
162
```
131
163
132
164
For a signal on the rotation group
133
165
134
-
```python
166
+
```python
167
+
import s2fft
168
+
169
+
# Define sampled signal to transform and harmonic and azimuthal bandlimits
170
+
f =...
171
+
L =...
172
+
N =...
135
173
# Compute Wigner coefficients
136
-
flmn = s2fft.wigner.forward_jax(f, L, N)
174
+
flmn = s2fft.wigner.forward(f, L, N, method="jax")
137
175
# Map back to pixel-space signal
138
-
f = fft.wigner.inverse_jax(flmn, L, N)
176
+
f = fft.wigner.inverse_jax(flmn, L, N, method="jax")
139
177
```
140
178
141
179
For further details on usage see the [documentation](https://astro-informatics.github.io/s2fft/) and associated [notebooks](https://astro-informatics.github.io/s2fft/tutorials/spherical_harmonic/spherical_harmonic_transform.html).
142
180
143
181
> [!NOTE]
144
-
> We also provide PyTorch support for the precompute version of our transforms. These are called through forward/inverse_torch(). Full PyTorch support will be provided in future releases.
182
+
> We also provide PyTorch support for the precompute version of our transforms, as demonstrated in the [_Torch frontend_ tutorial notebook](https://astro-informatics.github.io/s2fft/tutorials/torch_frontend/torch_frontend.html).
145
183
146
184
## JAX wrappers for SSHT and HEALPix 💡
147
185
148
186
`S2FFT` also provides JAX support for existing C/C++ packages, specifically [`HEALPix`](https://healpix.jpl.nasa.gov) and [`SSHT`](https://github.com/astro-informatics/ssht). This works
149
-
by wrapping python bindings with custom JAX frontends. Note that this C/C++ to JAX interoperability is currently limited to CPU.
187
+
by wrapping Python bindings with custom JAX frontends. Note that this C/C++ to JAX interoperability is currently limited to CPU.
150
188
151
189
For example, one may call these alternate backends for the spherical harmonic transform by:
For further details on usage see the associated [notebooks](https://astro-informatics.github.io/s2fft/tutorials/spherical_harmonic/JAX_SSHT_backend.html).
167
205
168
-
<!-- ## Benchmarking :hourglass_flowing_sand:
169
-
170
-
We benchmarked the spherical harmonic and Wigner transforms implemented
where the left hand results are for the recursive based algorithm and the right hand side are
192
-
our precompute implementation. -->
206
+
## Benchmarks ⏱️
207
+
208
+
A suite of benchmark functions for both the on-the-fly and precompute versions of the spherical harmonic and Wigner transforms are available in the `benchmarks` directory, along with utilities for running the benchmarks and plotting the results.
0 commit comments