From e3f7baa667bc6b06e5d1ccd26b59ea2201ee7953 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Wed, 19 Oct 2022 12:02:36 +0100 Subject: [PATCH] tests: test for gapped irregular dtauint added. --- tests/obs_test.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/obs_test.py b/tests/obs_test.py index 29ee67ba..5c6565fe 100644 --- a/tests/obs_test.py +++ b/tests/obs_test.py @@ -669,6 +669,23 @@ def test_gamma_method_irregular(): assert np.isclose(tau_a, tau_b) +def test_irregular_gapped_dtauint(): + my_idl = list(range(0, 5010, 10)) + my_idl.remove(400) + my_idl2 = list(range(0, 501, 1)) + my_idl2.remove(40) + + my_data = np.random.normal(1.1, 0.2, 500) + obs = pe.Obs([my_data], ["B1"], idl=[my_idl]) + obs.gamma_method() + + obs2 = pe.Obs([my_data], ["B2"], idl=[my_idl2]) + obs2.gamma_method() + + assert np.isclose(obs.e_tauint["B1"], obs2.e_tauint["B2"]) + assert np.isclose(obs.e_dtauint["B1"], obs2.e_dtauint["B2"]) + + def test_covariance_is_variance(): value = np.random.normal(5, 10) dvalue = np.abs(np.random.normal(0, 1))