Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integrate_spectrum for small integration ranges #2163

merged 2 commits into from May 27, 2019


Copy link

@adonath adonath commented May 27, 2019

This PR fixes a bug in the integrate_spectrum method reported by @luca-giunti. If emin and emax was within the same decade, the integration method would return 0, as the total number of sub-bins for the integration would be rounded to 0. A regression test is added as well.

@adonath adonath requested a review from luca-giunti May 27, 2019
@adonath adonath self-assigned this May 27, 2019
@adonath adonath added the bug label May 27, 2019
@adonath adonath added this to the 0.12 milestone May 27, 2019
Copy link

@luca-giunti luca-giunti left a comment

Hi @adonath! Thanks. Did you change the line n = int((logmax - logmin)) * ndecade in integrate_spectrum()? In the diff I only see the new test function.

Cheers :)

Copy link
Member Author

@adonath adonath commented May 27, 2019

@luca-giunti Thanks! Indeed the commit was missing, I just added it to the PR.

@adonath adonath merged commit b07cac1 into gammapy:master May 27, 2019
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants