s2fft is currently in an open beta, please provide feedback on GitHub

Wigner samples#

s2fft.sampling.so3_samples.elmn2ind(el: int, m: int, n: int, L: int, N: int) int#

Convert from Wigner space 3D indexing of \((\ell,m, n)\) to 1D index.

Parameters:
  • el (int) – Harmonic degree \(\ell\).

  • m (int) – Harmonic order \(m\).

  • n (int) – Directional order \(n\).

  • L (int) – Harmonic band-limit.

  • N (int, optional) – Directional band-limit. Defaults to 1.

Returns:

Corresponding 1D index in Wigner space.

Return type:

int

s2fft.sampling.so3_samples.f_shape(L: int, N: int, sampling: str = 'mw', nside: int | None = None) Tuple[int, int, int]#

Computes the pixel-space sampling shape for signal on the rotation group \(SO(3)\).

Note

Importantly, the convention adopted for storage of f is \([\beta, \alpha, \gamma]\), for Euler angles \((\alpha, \beta, \gamma)\) following the \(zyz\) Euler convention, in order to simplify indexing for internal use. For a given \(\gamma\) we thus recover a signal on the sphere indexed by \([\theta, \phi]\), i.e. we associate \(\beta\) with \(\theta\) and \(\alpha\) with \(\phi\).

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

  • N (int) – Directional band-limit.

  • sampling (str, optional) – Sampling scheme. Supported sampling schemes include {“mw”, “mwss”, “dh”, “gl”}. Defaults to “mw”.

  • nside (int, optional) – HEALPix Nside resolution parameter. Only required if sampling=”healpix”. Defaults to None.

Raises:

ValueError – Unknown sampling scheme.

Returns:

Shape of pixel-space sampling of rotation group \(SO(3)\).

Return type:

Tuple[int,int,int]

s2fft.sampling.so3_samples.flmn_1d_to_3d(flmn_1d: ndarray, L: int, N: int) ndarray#

Convert from 1D indexed Wigner coefficients to 3D indexed coefficients.

Parameters:
  • flm_1d (np.ndarray) – 1D indexed Wigner coefficients, C flatten index priority \(n, \ell, m\).

  • L (int) – Harmonic band-limit.

  • N (int) – Directional band-limit.

Raises:
  • ValueErrorflmn is already 3D indexed.

  • ValueErrorflmn is not 1D.

Returns:

3D indexed Wigner coefficients, index order \([\ell, m, n]\).

Return type:

np.ndarray

s2fft.sampling.so3_samples.flmn_3d_to_1d(flmn_3d: ndarray, L: int, N: int) ndarray#

Convert from 3D indexed Wigner coefficients to 1D indexed coefficients.

Parameters:
  • flm_3d (np.ndarray) – 3D indexed Wigner coefficients, index order \([\ell, m, n]\).

  • L (int) – Harmonic band-limit.

  • N (int, optional) – Directional band-limit.

Raises:
  • ValueErrorflmn is already 1D indexed.

  • ValueErrorflmn is not 3D.

Returns:

1D indexed Wigner coefficients, C flatten index priority \(n, \ell, m\).

Return type:

np.ndarray

s2fft.sampling.so3_samples.flmn_shape(L: int, N: int) Tuple[int, int, int]#

Computes the shape of Wigner coefficients for signal on the rotation group \(SO(3)\).

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

  • N (int) – Directional band-limit.

Returns:

Shape of Wigner space sampling of rotation group

\(SO(3)\).

Return type:

Tuple[int,int,int]

s2fft.sampling.so3_samples.flmn_shape_1d(L: int, N: int) int#

Computes the number of non-zero Wigner coefficients.

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

  • N (int) – Directional band-limit.

Returns:

Total number of non-zero Wigner coefficients.

Return type:

int

s2fft.sampling.so3_samples.fnab_shape(L: int, N: int, sampling: str = 'mw', nside: int | None = None) Tuple[int, int, int]#

Computes the shape of Wigner coefficients for signal on the rotation group \(SO(3)\).

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

  • N (int) – Directional band-limit.

  • sampling (str, optional) – Sampling scheme. Supported sampling schemes include {“mw”, “mwss”, “dh”, “gl”}. Defaults to “mw”.

  • nside (int, optional) – HEALPix Nside resolution parameter.

Raises:

ValueError – Unknown sampling scheme.

Returns:

Shape of Wigner space sampling of rotation group

\(SO(3)\).

Return type:

Tuple[int,int,int]