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

constructor#

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 = False, using_torch: bool = False)#

Precompute the wigner-d kernel for spin-spherical transform. This can be drastically faster but comes at a \(\mathcal{O}(L^3)\) memory overhead, making it infeasible for \(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”, “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.

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

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 = False)#

Precompute the wigner-d kernel for spin-spherical transform. This can be drastically faster but comes at a \(\mathcal{O}(L^3)\) memory overhead, making it infeasible for \(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”, “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.

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, using_torch: bool = False)#

Precompute the wigner-d kernels required for a Wigner transform. This can be drastically faster but comes at a \(\mathcal{O}(NL^3)\) memory overhead, making it infeasible for \(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.

  • 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)#

Precompute the wigner-d kernels required for a Wigner transform. This can be drastically faster but comes at a \(\mathcal{O}(NL^3)\) memory overhead, making it infeasible for \(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.

Returns:

Transform kernel for Wigner transform.

Return type:

jnp.ndarray