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

Wigner Matrices#

s2ball.construct.wigner_constructor.compute_wigner_warning(L: int, N: int)#

Basic compute warning for large Legendre precomputes.

Parameters:
  • L (int) – Harmonic band-limit.

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

Raises:

Warning – If the estimated time for precompute is large (\(L>=128\)).

s2ball.construct.wigner_constructor.construct_wigner_matrix(L: int, N: int, save_dir: str = '.matrices') ndarray#

Construct Wigner matrix which will be called during transform.

Parameters:
  • L (int) – Harmonic band-limit.

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

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

Returns:

Wigner matrix elements for forward Wigner transform.

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.construct.wigner_constructor.construct_wigner_matrix_inverse(L: int, N: int, save_dir: str = '.matrices') ndarray#

Construct associated Legendre inverse matrix for precompute method.

Parameters:
  • L (int) – Harmonic band-limit.

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

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

Returns:

Associated Legendre matrix for inverse harmonic transform.

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.construct.wigner_constructor.load_wigner_matrix(L: int, N: int, save_dir: str = '.matrices', forward: bool = True) ndarray#

Construct associated Legendre inverse matrix for precompute method.

Parameters:
  • L (int) – Harmonic band-limit.

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

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

  • forward (bool, optional) – Whether to load the forward or inverse matrices. Defaults to True.

Returns:

Associated Legendre matrix for corresponding harmonic transform.

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.