Skip to content

Commit

Permalink
Test ignored empty GTIs
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Nov 9, 2024
1 parent 648825b commit 0845f0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stingray/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0845f0d

Please sign in to comment.