Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Sep 27, 2023
1 parent 195dad7 commit 9267e68
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions stingray/tests/test_fourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,31 @@ def test_flux_iterables(dtype):
assert isinstance(er[0], cast_kind)


def test_avg_pds_imperfect_lc_size():
times = np.arange(100)
fluxes = np.ones(100).astype(float)
gti = np.asarray([[-0.5, 99.5]])
segment_size = 5.99
dt = 1
res = avg_pds_from_events(times, gti, segment_size, dt, fluxes=fluxes)
assert res.meta["segment_size"] == 5
assert res.meta["dt"] == 1


def test_avg_cs_imperfect_lc_size():
times1 = times2 = np.arange(100)
fluxes1 = np.ones(100).astype(float)
fluxes2 = np.ones(100).astype(float)
gti = np.asarray([[-0.5, 99.5]])
segment_size = 5.99
dt = 1
res = avg_cs_from_events(
times1, times2, gti, segment_size, dt, fluxes1=fluxes1, fluxes2=fluxes2
)
assert res.meta["segment_size"] == 5
assert res.meta["dt"] == 1


class TestCoherence(object):
@classmethod
def setup_class(cls):
Expand Down

0 comments on commit 9267e68

Please sign in to comment.