def test_zernike_integral0(scaling, int0, n=4): iterator = orthopy.s2.zernike.Eval(P, scaling) for k, vals in enumerate(itertools.islice(iterator, n)): if k == 0: assert _integrate_poly(vals[0]) == int0 else: for val in vals: assert _integrate_poly(val) == 0
def test_zernike2_normality(n=4): iterator = orthopy.s2.zernike2.Eval(P, "normal") for k, vals in enumerate(itertools.islice(iterator, n)): for val in vals: assert _integrate_poly(val**2) == 1
def test_zernike2_orthogonality(scaling, n=4): evaluator = orthopy.s2.zernike2.Eval(P, scaling) vals = numpy.concatenate([next(evaluator) for _ in range(n + 1)]) for f0, f1 in itertools.combinations(vals, 2): assert _integrate_poly(f0 * f1) == 0
def test_zernike_normality(n=5): iterator = orthopy.s2.zernike.Eval(P, "normal") for vals in itertools.islice(iterator, n): for val in vals: assert _integrate_poly(val ** 2) == 1