Skip to content

Commit

Permalink
Add test for doubling time coordinate
Browse files Browse the repository at this point in the history
Signed-off-by: cgalelli <[email protected]>
  • Loading branch information
cgalelli committed Dec 5, 2023
1 parent a12b15d commit adae2d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gammapy/estimators/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
resample_energy_edges,
)
from gammapy.maps import Map, MapAxis
from gammapy.utils.testing import requires_data
from gammapy.utils.testing import assert_time_allclose, requires_data


class TestFindPeaks:
Expand Down Expand Up @@ -191,6 +191,11 @@ def test_compute_lightcurve_doublingtime():
dtime = compute_lightcurve_doublingtime(lightcurve)
ddtime = dtime["doublingtime"].quantity
ddtime_err = dtime["doubling_err"].quantity
dcoord = dtime["doubling_coord"]

assert_allclose(ddtime, [[[245305.49]], [[481572.59]]] * u.s)
assert_allclose(ddtime_err, [[[45999.766]], [[11935.665]]] * u.s)
assert_time_allclose(
dcoord,
Time([[[55197.99960648]], [[55197.99960648]]], format="mjd", scale="utc"),
)

0 comments on commit adae2d2

Please sign in to comment.