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

Generating Functions#

s2ball.wavelets.kernels.binomial_coefficient(n: int, k: int) int#

Computes the binomial coefficient \(\binom{n}{k}\). :param n: Number of elements to choose from. :type n: int :param k: Number of elements to pick. :type k: int

Returns:

Number of possible subsets.

Return type:

(int)

s2ball.wavelets.kernels.k_lam(L: int, lam: float = 2.0, quad_iters: int = 300) float#

Compute function \(k_{\lambda}\) used as a wavelet generating function. Specifically, this function is derived in [1] and is given by

\[k_{\lambda} \equiv \frac{ \int_t^1 \frac{\text{d}t^{\prime}}{t^{\prime}} s_{\lambda}^2(t^{\prime})}{ \int_{\frac{1}{\lambda}}^1 \frac{\text{d}t^{\prime}}{t^{\prime}} s_{\lambda}^2(t^{\prime})},\]

where the integrand is defined to be

\[s_{\lambda} \equiv s \Big ( \frac{2\lambda}{\lambda - 1}(t-\frac{1}{\lambda}) - 1 \Big ),\]

for infinitely differentiable Cauchy-Schwartz function \(s(t) \in C^{\infty}\).

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

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

  • quad_iters (int, optional) – Total number of iterations for quadrature integration. Defaults to 300.

Returns:

Value of \(k_{\lambda}\) computed for values between

\(\frac{1}{\lambda}\) and 1, parametrised by \(\ell\) as required to compute the axisymmetric filters in tiling_axisym().

Return type:

(np.ndarray)

Note

[1] B. Leidstedt et. al., “S2LET: A code to perform fast wavelet analysis on the sphere”, A&A, vol. 558, p. A128, 2013.

s2ball.wavelets.kernels.part_scaling_fn(a: float, b: float, n: int, lam: float = 2.0) float#

Computes integral used to calculate smoothly decreasing function \(k_{\lambda}\). Intermediate step used to compute the wavelet and scaling function generating functions. Uses the trapezium method to integrate tiling_integrand() in the limits from \(a \rightarrow b\) with scaling parameter \(\lambda\). One of the basic mathematical functions needed to carry out the tiling of the harmonic space. :param a: Lower limit of the numerical integration. :type a: float :param b: Upper limit of the numerical integration. :type b: float :param n: Number of steps to be performed during integration. :type n: int :param lam: Wavelet parameter which determines the scale factor

between consecutive wavelet scales.Note that \(\lambda = 2\) indicates dyadic wavelets. Defaults to 2.

Returns:

Integral of the tiling integrand from \(a \rightarrow b\).

Return type:

float

s2ball.wavelets.kernels.tiling_direction(L: int, N: int) ndarray#
Generates the harmonic coefficients for the directionality component of the

tiling functions.

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

  • N (int) – Upper orientational band-limit.

Returns:

Harmonic coefficients of directionality components

\(_{s}\eta_{\ell m}\).

Return type:

np.ndarray

Notes

[1] J. McEwen et. al., “Directional spin wavelets on the sphere”, arXiv preprint arXiv:1509.06749 (2015).

s2ball.wavelets.kernels.tiling_integrand(t: float, lam: float = 2.0) float#

Tiling integrand for scale-discretised wavelets [1]. Intermediate step used to compute the wavelet and scaling function generating functions. One of the basic mathematical functions needed to carry out the tiling of the harmonic space. :param t: Real argument over which we integrate. :type t: float :param lam: Wavelet parameter which determines the scale factor

between consecutive wavelet scales.Note that \(\lambda = 2\) indicates dyadic wavelets. Defaults to 2.

Returns:

Value of tiling integrand for given \(t\) and scaling factor.

Return type:

float

Note

[1] B. Leidstedt et. al., “S2LET: A code to perform fast wavelet analysis on the sphere”, A&A, vol. 558, p. A128, 2013.