astro-informatics/sleplet

[A] Eq 17, test leakage?

paddyroddy opened this issue · 2 comments

Numerically calculate it. Proportion of energy inside vs outside
image

Made a start

def test_proportion_wavelet_energy_leakage_polar(
    slepian_polar_cap, earth_polar_cap
) -> None:
    """
    tests that the proportion of function energy leakage is as expected
    """
    field = ssht.inverse(
        earth_polar_cap.coefficients, slepian_polar_cap.L, Method=SAMPLING_SCHEME
    )
    integrate_region_p = slepian_forward(
        slepian_polar_cap.L,
        slepian_polar_cap,
        f=field,
        mask=slepian_polar_cap.mask,
        n_coeffs=earth_polar_cap.L**2,
    )
    slepian_energy = np.abs(integrate_region_p) ** 2
    proportion_inside = (
        slepian_energy[: slepian_polar_cap.N].sum() / slepian_energy.sum()
    )

Leakage tests added