Skip to content

Instantly share code, notes, and snippets.

@cdeil
Created June 10, 2016 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdeil/40b4914be44a3575416b7c7cd8c8311d to your computer and use it in GitHub Desktop.
Save cdeil/40b4914be44a3575416b7c7cd8c8311d to your computer and use it in GitHub Desktop.
import numpy as np
from numpy.testing import assert_allclose
from astropy.units import Quantity
from exptest import exptest_for_run
from gammapy.time import make_random_times_poisson_process
def test_exptest_for_run():
# setup
rate = Quantity(100, 's^-1')
time_delta = make_random_times_poisson_process(1000, rate=rate, random_state=0)
print('time_delta = {}'.format(time_delta))
# execution
mr = exptest_for_run(time_delta)
print('mr = {}'.format(mr))
# checks on results
assert_allclose(mr, 1.3790634240947202)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment