Created
June 10, 2016 11:31
-
-
Save cdeil/40b4914be44a3575416b7c7cd8c8311d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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