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

JAX Transforms (Recursive)#

s2wav.transforms.wavelet.analysis(f: Array, L: int, N: int = 1, J_min: int = 0, lam: float = 2.0, spin: int = 0, sampling: str = 'mw', nside: int = None, reality: bool = False, filters: Tuple[Array] = None, precomps: List[List[Array]] = None) Tuple[Array]#

Wavelet analysis from pixel space to wavelet space for complex signals.

Parameters:
  • f (jnp.ndarray) – Signal \(f\) on the sphere with shape \([n_{\theta}, n_{\phi}]\).

  • L (int) – Harmonic bandlimit.

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

  • J_min (int, optional) – Lowest frequency wavelet scale to be used. Defaults to 0.

  • lam (float, optional) – Wavelet parameter which determines the scale factor between consecutive wavelet scales. Note that \(\lambda = 2\) indicates dyadic wavelets. Defaults to 2.

  • spin (int, optional) – Spin (integer) of input signal. Defaults to 0.

  • sampling (str, optional) – Spherical sampling scheme from {“mw”,”mwss”, “dh”, “healpix”}. Defaults to “mw”.

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

  • reality (bool, optional) – Whether \(f \in \mathbb{R}\), if True exploits conjugate symmetry of harmonic coefficients. Defaults to False.

  • filters (Tuple[jnp.ndarray], optional) – Precomputed wavelet filters. Defaults to None.

  • precomps (List[jnp.ndarray]) – Precomputed list of recursion coefficients. At most of length \(L^2\), which is a minimal memory overhead.

Returns:

Array of wavelet pixel-space coefficients

with shape \([n_{J}, 2N-1, n_{\theta}, n_{\phi}]\).

f_scal (jnp.ndarray): Array of scaling pixel-space coefficients

with shape \([n_{\theta}, n_{\phi}]\).

Return type:

f_wav (jnp.ndarray)

s2wav.transforms.wavelet.flm_to_analysis(flm: Array, L: int, N: int = 1, J_min: int = 0, J_max: int = None, lam: float = 2.0, sampling: str = 'mw', nside: int = None, reality: bool = False, filters: Tuple[Array] = None, precomps: List[List[Array]] = None) Tuple[Array]#

Wavelet analysis from pixel space to wavelet space for complex signals.

Parameters:
  • f (jnp.ndarray) – Signal \(f\) on the sphere with shape \([n_{\theta}, n_{\phi}]\).

  • L (int) – Harmonic bandlimit.

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

  • J_min (int, optional) – Lowest frequency wavelet scale to be used. Defaults to 0.

  • J_max (int, optional) – Highest frequency wavelet scale to be used. Defaults to None.

  • lam (float, optional) – Wavelet parameter which determines the scale factor between consecutive wavelet scales. Note that \(\lambda = 2\) indicates dyadic wavelets. Defaults to 2.

  • sampling (str, optional) – Spherical sampling scheme from {“mw”,”mwss”, “dh”, “healpix”}. Defaults to “mw”.

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

  • reality (bool, optional) – Whether \(f \in \mathbb{R}\), if True exploits conjugate symmetry of harmonic coefficients. Defaults to False.

  • filters (jnp.ndarray, optional) – Precomputed wavelet filters. Defaults to None.

  • precomps (List[jnp.ndarray]) – Precomputed list of recursion coefficients. At most of length \(L^2\), which is a minimal memory overhead.

Returns:

Array of wavelet pixel-space coefficients

with shape \([n_{J}, 2N-1, n_{\theta}, n_{\phi}]\).

Return type:

f_wav (jnp.ndarray)

s2wav.transforms.wavelet.synthesis(f_wav: Array, f_scal: Array, L: int, N: int = 1, J_min: int = 0, lam: float = 2.0, spin: int = 0, sampling: str = 'mw', nside: int = None, reality: bool = False, filters: Tuple[Array] = None, precomps: List[List[Array]] = None) Array#
Computes the synthesis directional wavelet transform [1,2].

Specifically, this transform synthesises the signal \(_{s}f(\omega) \in \mathbb{S}^2\) by summing the contributions from wavelet and scaling coefficients in harmonic space, see equation 27 from [2].

Parameters:
  • f_wav (jnp.ndarray) – Array of wavelet pixel-space coefficients with shape \([n_{J}, 2N-1, n_{\theta}, n_{\phi}]\).

  • f_scal (jnp.ndarray) – Array of scaling pixel-space coefficients with shape \([n_{\theta}, n_{\phi}]\).

  • L (int) – Harmonic bandlimit.

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

  • J_min (int, optional) – Lowest frequency wavelet scale to be used. Defaults to 1.

  • lam (float, optional) – Wavelet parameter which determines the scale factor between consecutive wavelet scales. Note that \(\lambda = 2\) indicates dyadic wavelets. Defaults to 2.

  • spin (int, optional) – Spin (integer) of input signal. Defaults to 0.

  • sampling (str, optional) – Spherical sampling scheme from {“mw”,”mwss”, “dh”, “healpix”}. Defaults to “mw”.

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

  • reality (bool, optional) – Whether \(f \in \mathbb{R}\), if True exploits conjugate symmetry of harmonic coefficients. Defaults to False.

  • filters (Tuple[jnp.ndarray], optional) – Precomputed wavelet filters. Defaults to None.

  • precomps (List[jnp.ndarray]) – Precomputed list of recursion coefficients. At most of length \(L^2\), which is a minimal memory overhead.

Returns:

Signal \(f\) on the sphere with shape \([n_{\theta}, n_{\phi}]\).

Return type:

jnp.ndarray

Notes

[1] B. Leidstedt et. al., “S2LET: A code to perform fast wavelet analysis on the sphere”, A&A, vol. 558, p. A128, 2013. [2] J. McEwen et. al., “Directional spin wavelets on the sphere”, arXiv preprint arXiv:1509.06749 (2015).