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

Improve EnergyDispersion2D get_response and tests #911

Merged
merged 5 commits into from Feb 24, 2017

Conversation

Projects
None yet
3 participants
@registerrier
Contributor

registerrier commented Feb 23, 2017

This introduces a different get_response() where integration is done with a given step in migration rather than with a fixed oversampling of e_reco bins.

  • The default value for the migra_step allows a significant decrease of computation time and allow for absolute precision <0.05.
  • Tests have been modified to test for a gaussian edisp where we can compute the desired value with satisfactory precision (<5% absolute)
  • Note that all tests on EnergyDispersion2D could be done with gaussian edisp rather than stored one.

@registerrier registerrier requested review from cdeil and joleroi Feb 23, 2017

@joleroi joleroi self-assigned this Feb 23, 2017

@joleroi joleroi added the cleanup label Feb 23, 2017

@joleroi

Thanks for this implementation and especially the test, it's always good to have tests from people that know what they're doing 😃 I left 2 comment mostly about code organization. I trust you that the gaussian edisp is coded correctly!

Show outdated Hide outdated gammapy/irf/energy_dispersion.py Outdated
Show outdated Hide outdated gammapy/irf/tests/test_energy_dispersion.py Outdated
@registerrier

This comment has been minimized.

Show comment
Hide comment
@registerrier

registerrier Feb 23, 2017

Contributor

I have added the _from_gauss function in the EnergyDispersion2D class.
I corrected a small issue that makes agreement between analytical solution and get_response better.
Use step of 1e-2 in the test gives result <0.05 in absolute error.

Contributor

registerrier commented Feb 23, 2017

I have added the _from_gauss function in the EnergyDispersion2D class.
I corrected a small issue that makes agreement between analytical solution and get_response better.
Use step of 1e-2 in the test gives result <0.05 in absolute error.

@cdeil

I left some more inline comments requesting some superficial code changes. I don't have time to review the formulas or method.

Show outdated Hide outdated gammapy/irf/energy_dispersion.py Outdated
Show outdated Hide outdated gammapy/irf/energy_dispersion.py Outdated
Show outdated Hide outdated gammapy/irf/energy_dispersion.py Outdated
Show outdated Hide outdated gammapy/irf/energy_dispersion.py Outdated
Show outdated Hide outdated gammapy/irf/tests/test_energy_dispersion.py Outdated
@cdeil

cdeil approved these changes Feb 24, 2017

@registerrier

This comment has been minimized.

Show comment
Hide comment
@registerrier

registerrier Feb 24, 2017

Contributor

Modified test_data_store to add absolute tolerance of 2% to result.

Contributor

registerrier commented Feb 24, 2017

Modified test_data_store to add absolute tolerance of 2% to result.

@joleroi

This comment has been minimized.

Show comment
Hide comment
@joleroi

joleroi Feb 24, 2017

Contributor

As far as I can see, we merge this and close #894 ?

Contributor

joleroi commented Feb 24, 2017

As far as I can see, we merge this and close #894 ?

@joleroi

This comment has been minimized.

Show comment
Hide comment
@joleroi

joleroi Feb 24, 2017

Contributor

This looks like it was introduced in this PR
https://travis-ci.org/gammapy/gammapy/builds/204946729
I will have a look

Contributor

joleroi commented Feb 24, 2017

This looks like it was introduced in this PR
https://travis-ci.org/gammapy/gammapy/builds/204946729
I will have a look

@joleroi joleroi merged commit f1f9f55 into gammapy:master Feb 24, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@cdeil cdeil added the bug label Apr 28, 2017

@cdeil cdeil added this to the 0.6 milestone Apr 28, 2017

@cdeil cdeil changed the title from Improved EnergyDispersion2D.get_response and associated tests to Improve EnergyDispersion2D get_response and tests Apr 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment