diff --git a/ctapipe/image/tests/test_toy.py b/ctapipe/image/tests/test_toy.py index 85f762421af..c762e722731 100644 --- a/ctapipe/image/tests/test_toy.py +++ b/ctapipe/image/tests/test_toy.py @@ -58,7 +58,7 @@ def test_intensity(seed, monkeypatch, prod5_lst): def test_skewed(prod5_lst): - from ctapipe.image.toymodel import SkewedGaussian + from ctapipe.image.toymodel import SkewedCauchy, SkewedGaussian # test if the parameters we calculated for the skew normal # distribution produce the correct moments @@ -84,6 +84,18 @@ def test_skewed(prod5_lst): assert np.isclose(var, length.to_value(u.m) ** 2) assert np.isclose(skew, skewness) + model = SkewedCauchy( + x=x, y=y, width=width, length=length, psi=psi, skewness=skewness + ) + model.generate_image(geom, intensity=intensity, nsb_level_pe=5, rng=rng) + + a, loc, scale = model._moments_to_parameters() + mean, var, skew = skewnorm(a=a, loc=loc, scale=scale).stats(moments="mvs") + + assert np.isclose(mean, 0) + assert np.isclose(var, length.to_value(u.m) ** 2) + assert np.isclose(skew, skewness) + def test_compare(prod5_lst): from ctapipe.image.toymodel import Gaussian, SkewedGaussian