s2ball is currently in an open alpha, please provide feedback on GitHub

Wigner#

s2ball.transform.wigner.forward(f: ndarray, L: int, N: int, wigner_matrices: ndarray | None = None, method: str = 'jax', save_dir: str = '.matrices', adjoint: bool = False) ndarray#

Compute forward Wigner transform.

This transform trivially supports batching.

Parameters:
  • f (np.ndarray) – Signal on rotation group, with shape: [2N-1, L, 2L-1].

  • L (int) – Harmonic band-limit.

  • N (int) – Directional band-limit. Must be < L.

  • wigner_matrices (np.ndarray, optional) – List of Wigner transform matrices. Defaults to None.

  • method (str, optional) – Evaluation method in {“numpy”, “jax”}. Defaults to “jax”.

  • save_dir (str, optional) – Directory in which to save precomputed matrices. Defaults to “.matrices”.

  • adjoint (bool, optional) – Whether to return adjoint transformation. Defaults to False.

Raises:

ValueError – Method not in {“numpy”, “jax”}.

Returns:

Wigner coefficients with shape [2N-1, L, 2L-1].

Return type:

np.ndarray

Note

Currently only McEwen-Wauix sampling on the sphere is supported, though this approach can be extended to alternate sampling schemes, e.g. HEALPix.

s2ball.transform.wigner.forward_transform(f: ndarray, wigner_matrices: ndarray, L: int, N: int, shift: int = 0) ndarray#

Compute the forward Wigner transform with Numpy.

This transform trivially supports batching.

Parameters:
  • f (np.ndarray) – Signal on rotation group, with shape: [2N-1, L, 2L-1].

  • wigner_matrices (np.ndarray) – List of Wigner transform matrices.

  • L (int) – Harmonic band-limit.

  • N (int) – Directional band-limit. Must be < L.

  • shift (int, optional) – Used internally to handle adjoint transforms.

Returns:

Wigner coefficients with shape [2N-1, L, 2L-1].

Return type:

np.ndarray

Note

Currently only McEwen-Wauix sampling on the sphere is supported, though this approach can be extended to alternate sampling schemes, e.g. HEALPix.

s2ball.transform.wigner.forward_transform_jax(f: Array, wigner_matrices: Array, L: int, N: int, shift: int = 0) Array#

Compute the forward Wigner transform with JAX and JIT.

This transform trivially supports batching.

Parameters:
  • f (jnp.ndarray) – Signal on rotation group, with shape: [2N-1, L, 2L-1].

  • wigner_matrices (jnp.ndarray) – List of Wigner transform matrices.

  • L (int) – Harmonic band-limit.

  • N (int) – Directional band-limit. Must be < L.

  • shift (int, optional) – Used internally to handle adjoint transforms.

Returns:

Wigner coefficients with shape [2N-1, L, 2L-1].

Return type:

jnp.ndarray

Note

Currently only McEwen-Wauix sampling on the sphere is supported, though this approach can be extended to alternate sampling schemes, e.g. HEALPix.

s2ball.transform.wigner.inverse(fnlm: ndarray, L: int, N: int, wigner_matrices: ndarray | None = None, method: str = 'jax', save_dir: str = '.matrices', adjoint: bool = False) ndarray#

Compute the inverse Wigner transform.

This transform trivially supports batching.

Parameters:
  • fnlm (np.ndarray) – Wigner coefficients, with shape: [2N-1, L, 2L-1].

  • L (int) – Harmonic band-limit.

  • N (int) – Directional band-limit. Must be < L.

  • wigner_matrices (np.ndarray, optional) – List of Wigner transform matrices. Defaults to None.

  • method (str, optional) – Evaluation method in {“numpy”, “jax”}. Defaults to “jax”.

  • save_dir (str, optional) – Directory in which to save precomputed matrices. Defaults to “.matrices”.

  • adjoint (bool, optional) – Whether to return adjoint transformation. Defaults to False.

Raises:

ValueError – Deployment method not in {“numpy”, “jax”}.

Returns:

Pixel-space coefficients with shape [2N-1, L, 2L-1].

Return type:

np.ndarray

Note

Currently only McEwen-Wauix sampling on the sphere is supported, though this approach can be extended to alternate sampling schemes, e.g. HEALPix.

s2ball.transform.wigner.inverse_transform(fnlm: ndarray, wigner_matrices: ndarray, L: int, shift: int = 0) ndarray#

Compute the inverse Wigner transform with Numpy.

Parameters:
  • fnlm (np.ndarray) – Wigner coefficients, with shape: [2N-1, L, 2L-1].

  • wigner_matrices (np.ndarray) – List of Wigner transform matrices.

  • L (int) – Harmonic band-limit.

  • shift (int, optional) – Used internally to handle adjoint transforms.

Returns:

Pixel-space coefficients with shape [2N-1, L, 2L-1].

Return type:

np.ndarray

Note

Currently only McEwen-Wauix sampling on the sphere is supported, though this approach can be extended to alternate sampling schemes, e.g. HEALPix.

s2ball.transform.wigner.inverse_transform_jax(fnlm: Array, wigner_matrices: Array, L: int, shift: int = 0) Array#

Compute the inverse Wigner transform via precompute (JAX implementation).

Parameters:
  • fnlm (jnp.ndarray) – Wigner coefficients, with shape: [2N-1, L, 2L-1].

  • wigner_matrices (jnp.ndarray) – List of Wigner transform matrices.

  • L (int) – Harmonic band-limit.

  • shift (int, optional) – Used internally to handle adjoint transforms.

Returns:

Pixel-space coefficients with shape [2N-1, L, 2L-1].

Return type:

jnp.ndarray

Note

Currently only McEwen-Wauix sampling on the sphere is supported, though this approach can be extended to alternate sampling schemes, e.g. HEALPix.