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

Add light curve computation #950

Merged
merged 8 commits into from Mar 17, 2017

Conversation

Projects
None yet
2 participants
@jjlk
Contributor

jjlk commented Mar 14, 2017

Hi @cdeil,
As we discussed, here is a first attempt to deal with light curves. Implementation follows closely what has been done in the the H.E.S.S. publication: http://adsabs.harvard.edu/abs/2010A%26A...520A..83H.

This PR:

  • add a LightCurveFactory class
  • modify LightCurve.plot and LightCurve.simulate functions (I replaced seconds by MJD values)
  • add a small test (only checking the length of the output LightCurve object since values might change after checking that the results are okés)
    ++

PS: forgot to say that there is room for improvements, different time bining definitions (only run bye run, or user defined binning are implemented) and optimisation of the code, I guess I'm doing too much loops =)

@cdeil cdeil self-assigned this Mar 14, 2017

@cdeil cdeil added the feature label Mar 14, 2017

@cdeil cdeil added this to the 0.6 milestone Mar 14, 2017

@cdeil cdeil changed the title from Light curve to Add light curve computation Mar 14, 2017

@cdeil

@jjlk - Thank you!

I've left a bunch of inline comments.
Please decide for yourself what you want to implement here and defer to future PRs (or reject as a suggestion), and let me know when this is ready to merge from your side.

Show outdated Hide outdated gammapy/time/lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/tests/test_lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/tests/test_lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/tests/test_lightcurve.py Outdated
Show outdated Hide outdated gammapy/time/tests/test_lightcurve.py Outdated
@cdeil

cdeil approved these changes Mar 16, 2017

jjlk added some commits Mar 16, 2017

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Mar 17, 2017

Member

Thanks!

Member

cdeil commented Mar 17, 2017

Thanks!

@cdeil cdeil merged commit 2359586 into gammapy:master Mar 17, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Mar 17, 2017

Member

I've split out the computation for one time bin into a separate method in 3cd7d76
and done some minor cleanup, like renaming "on" to "n_on" (trying to go towards more consistency within Gammapy, and following the names chosen here.

Member

cdeil commented Mar 17, 2017

I've split out the computation for one time bin into a separate method in 3cd7d76
and done some minor cleanup, like renaming "on" to "n_on" (trying to go towards more consistency within Gammapy, and following the names chosen here.

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