Ejemplo n.º 1
0
def test_jinc_equivalence(a: float, order: int, radius: np.ndarray):
    transformer = HankelTransform(order=order, radial_grid=radius)
    f = generalised_jinc(radius, a, order)
    kr, one_shot_ht = qdht(radius, f, order=order)

    f_t = generalised_jinc(transformer.r, a, transformer.order)
    standard_ht = transformer.qdht(f_t)
    assert np.allclose(one_shot_ht, standard_ht)
Ejemplo n.º 2
0
def test_top_hat(radius: np.ndarray, a: float, order: int):
    f = generalised_top_hat(radius, a, order)
    kr, actual_ht = qdht(radius, f, order)
    v = kr / (2 * np.pi)
    expected_ht = generalised_jinc(v, a, order)
    error = np.mean(np.abs(expected_ht-actual_ht))
    assert error < 1e-3