constructor#

s2fft.precompute_transforms.construct.fourier_wigner_kernel(L: int) Tuple[ndarray, ndarray]#

Computes Fourier coefficients of the reduced Wigner d-functions and quadrature weights upsampled for the forward Fourier-Wigner transform.

Parameters:

L (int) – Harmonic band-limit.

Returns:

Tuple of delta Fourier coefficients and weights.

Return type:

Tuple[np.ndarray, np.ndarray]

s2fft.precompute_transforms.construct.fourier_wigner_kernel_jax(L: int) Tuple[Array, Array]#

Computes Fourier coefficients of the reduced Wigner d-functions and quadrature weights upsampled for the forward Fourier-Wigner transform (JAX implementation).

Parameters:

L (int) – Harmonic band-limit.

Returns:

Tuple of delta Fourier coefficients and weights.

Return type:

Tuple[jnp.ndarray, jnp.ndarray]

s2fft.precompute_transforms.construct.healpix_phase_shifts(L: int, nside: int, forward: bool = False) ndarray#

Generates a phase shift vector for HEALPix for all \(\theta\) rings.

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

  • nside (int) – HEALPix Nside resolution parameter.

  • forward (bool, optional) – Whether to provide forward or inverse shift. Defaults to False.

Returns:

Vector of phase shifts with shape \([thetas, 2L-1]\).

Return type:

np.ndarray

s2fft.precompute_transforms.construct.spin_spherical_kernel(L: int, spin: int = 0, reality: bool = False, sampling: str = 'mw', nside: int | None = None, forward: bool = True, using_torch: bool = False, recursion: str = 'auto') ndarray#

Precompute the wigner-d kernel for spin-spherical transform.

This implementation is typically faster than computing these elements on-the-fly but comes at a \(\mathcal{O}(L^3)\) memory overhead, making it infeasible for large bandlimits \(L\geq 512\).

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

  • spin (int) – Harmonic spin.

  • reality (bool, optional) – Whether the signal on the sphere is real. If so, conjugate symmetry is exploited to reduce computational costs. Defaults to False.

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

  • nside (int) – HEALPix Nside resolution parameter. Only required if sampling=”healpix”.

  • forward (bool, optional) – Whether to provide forward or inverse shift. Defaults to False.

  • using_torch (bool, optional) – Desired frontend functionality. Defaults to False.

  • recursion (str, optional) – Recursion to adopt. Supported recursion schemes include {“auto”, “price-mcewen”, “risbo”}. Defaults to “auto” which will detect the most appropriate recursion given the parameter configuration.

Returns:

Transform kernel for spin-spherical harmonic transform.

Return type:

np.ndarray

s2fft.precompute_transforms.construct.spin_spherical_kernel_jax(L: int, spin: int = 0, reality: bool = False, sampling: str = 'mw', nside: int | None = None, forward: bool = True, recursion: str = 'auto') Array#

Precompute the wigner-d kernel for spin-spherical transform.

This implementation is typically faster than computing these elements on-the-fly but comes at a \(\mathcal{O}(L^3)\) memory overhead, making it infeasible for large bandlimits \(L\geq 512\).

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

  • spin (int) – Harmonic spin.

  • reality (bool, optional) – Whether the signal on the sphere is real. If so, conjugate symmetry is exploited to reduce computational costs. Defaults to False.

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

  • nside (int) – HEALPix Nside resolution parameter. Only required if sampling=”healpix”.

  • forward (bool, optional) – Whether to provide forward or inverse shift. Defaults to False.

  • recursion (str, optional) – Recursion to adopt. Supported recursion schemes include {“auto”, “price-mcewen”, “risbo”}. Defaults to “auto” which will detect the most appropriate recursion given the parameter configuration.

Returns:

Transform kernel for spin-spherical harmonic transform.

Return type:

jnp.ndarray

s2fft.precompute_transforms.construct.wigner_kernel(L: int, N: int, reality: bool = False, sampling: str = 'mw', nside: int | None = None, forward: bool = False, mode: str = 'auto', using_torch: bool = False) ndarray#

Precompute the wigner-d kernel for Wigner transform.

This implementation is typically faster than computing these elements on-the-fly but comes at a \(\mathcal{O}(NL^3)\) memory overhead, making it infeasible for large bandlimits \(L\geq 512\).

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

  • N (int) – Directional band-limit.

  • reality (bool, optional) – Whether the signal on the sphere is real. If so, conjugate symmetry is exploited to reduce computational costs. Defaults to False.

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

  • nside (int) – HEALPix Nside resolution parameter. Only required if sampling=”healpix”.

  • forward (bool, optional) – Whether to provide forward or inverse shift. Defaults to False.

  • mode (str, optional) – Whether to use FFT approach or manually compute each element. {“auto”, “direct”, “fft”}. Defaults to “auto” which will detect the most appropriate recursion given the parameter configuration.

  • using_torch (bool, optional) – Desired frontend functionality. Defaults to False.

Returns:

Transform kernel for Wigner transform.

Return type:

np.ndarray

s2fft.precompute_transforms.construct.wigner_kernel_jax(L: int, N: int, reality: bool = False, sampling: str = 'mw', nside: int | None = None, forward: bool = False, mode: str = 'auto') Array#

Precompute the wigner-d kernel for Wigner transform.

This implementation is typically faster than computing these elements on-the-fly but comes at a \(\mathcal{O}(NL^3)\) memory overhead, making it infeasible for large bandlimits \(L\geq 512\).

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

  • N (int) – Directional band-limit.

  • reality (bool, optional) – Whether the signal on the sphere is real. If so, conjugate symmetry is exploited to reduce computational costs. Defaults to False.

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

  • nside (int) – HEALPix Nside resolution parameter. Only required if sampling=”healpix”.

  • forward (bool, optional) – Whether to provide forward or inverse shift. Defaults to False.

  • mode (str, optional) – Whether to use FFT approach or manually compute each element. {“auto”, “direct”, “fft”}. Defaults to “auto” which will detect the most appropriate recursion given the parameter configuration.

Returns:

Transform kernel for Wigner transform.

Return type:

jnp.ndarray