From 0845f0d151f805bf45bb61f997133cece31cd76c Mon Sep 17 00:00:00 2001 From: Matteo Bachetti Date: Sat, 9 Nov 2024 14:31:05 +0100 Subject: [PATCH] Test ignored empty GTIs --- stingray/tests/test_io.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stingray/tests/test_io.py b/stingray/tests/test_io.py index 4ba5bdc7b..f81928d07 100644 --- a/stingray/tests/test_io.py +++ b/stingray/tests/test_io.py @@ -263,6 +263,13 @@ def test_read_apply_gti_lists(self, root_file_name, gti_kind): # Check that the gtis of the output event lists are the same we input assert np.allclose(ev.gti, gti_list[i]) + def test_read_apply_gti_lists_ignore_empty(self): + reader = FITSTimeseriesReader(self.fname, output_class=EventList) + gti_list = [[], [[80000000, 80000512]], [[80000513, 80001024]]] + evs = list(reader.apply_gti_lists(gti_list)) + assert np.allclose(evs[0].gti, gti_list[1]) + assert np.allclose(evs[1].gti, gti_list[2]) + def test_read_fits_timeseries_by_nsamples(self): reader = FITSTimeseriesReader(self.fname, output_class=EventList) # Full slice