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 flux point computation using Lafferty & Wyatt (1995) #128

Merged
merged 3 commits into from Jul 10, 2014

Conversation

Projects
None yet
2 participants
@ellisowen
Contributor

ellisowen commented Jun 11, 2014

Implements #50 .

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 11, 2014

Contributor

Pull request as you asked - It's not clear to me what is complete and what is work in progress as it's been a few weeks since I worked on this. I'll make this more complete over the next few days.

Contributor

ellisowen commented Jun 11, 2014

Pull request as you asked - It's not clear to me what is complete and what is work in progress as it's been a few weeks since I worked on this. I'll make this more complete over the next few days.

@cdeil cdeil added this to the 0.1 milestone Jun 11, 2014

@cdeil cdeil added the feature label Jun 11, 2014

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 11, 2014

Member

Please rebase this again against the master branch.
I just merged e45ca57 with a ton of whitespace changes which will probably create extra rebase conflicts.

Member

cdeil commented Jun 11, 2014

Please rebase this again against the master branch.
I just merged e45ca57 with a ton of whitespace changes which will probably create extra rebase conflicts.

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 13, 2014

Contributor

Still in progress - adding unit tests & docstrings. The actual Lafferty flux point implementation looks a bit fishy, so I will investigate if I actually did this correctly or if it was just a quick hack while I worked on the API.

Contributor

ellisowen commented Jun 13, 2014

Still in progress - adding unit tests & docstrings. The actual Lafferty flux point implementation looks a bit fishy, so I will investigate if I actually did this correctly or if it was just a quick hack while I worked on the API.

Show outdated Hide outdated gammapy/stats/data.py Outdated
Show outdated Hide outdated gammapy/stats/tests/test_data.py Outdated
Show outdated Hide outdated gammapy/stats/tests/test_script.py Outdated
Show outdated Hide outdated gammapy/stats/data.py Outdated
Show outdated Hide outdated gammapy/stats/data.py Outdated
Show outdated Hide outdated gammapy/stats/data.py Outdated
Show outdated Hide outdated gammapy/stats/data.py Outdated
Show outdated Hide outdated gammapy/stats/data.py Outdated
@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 17, 2014

Contributor

Just spotted some other things to change - will commit again shortly.

Contributor

ellisowen commented Jun 17, 2014

Just spotted some other things to change - will commit again shortly.

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 17, 2014

Contributor

The data file 'read' function I think can be improved (and tests added), but I will do this later in a separate pull request.

Contributor

ellisowen commented Jun 17, 2014

The data file 'read' function I think can be improved (and tests added), but I will do this later in a separate pull request.

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 17, 2014

Contributor

I think this is OK now - Please can you review?

Contributor

ellisowen commented Jun 17, 2014

I think this is OK now - Please can you review?

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 17, 2014

Member

Here's the API we discussed just now:
http://nbviewer.ipython.org/gist/cdeil/c49b786a9e6ceca19c95

The documentation of the format should be in gammapy/docs/dataformats/spectra.rst ... thinking about it some more we don't even need our own read and write methods ... users can just use the Table methods and rename columns to be consistent if needed themselves. It's the most flexible approach for the user and the lest work for us.

Member

cdeil commented Jun 17, 2014

Here's the API we discussed just now:
http://nbviewer.ipython.org/gist/cdeil/c49b786a9e6ceca19c95

The documentation of the format should be in gammapy/docs/dataformats/spectra.rst ... thinking about it some more we don't even need our own read and write methods ... users can just use the Table methods and rename columns to be consistent if needed themselves. It's the most flexible approach for the user and the lest work for us.

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 18, 2014

Contributor

Implements as we discussed yesterday - seems to give consistent conversion between integral and differential fluxes and back again. Still need to check whether the actual values are correct though.

I still need to:

  • Add an example
  • Add unit tests
  • Update docstrings
  • Change syntax to be consistent with that used in gammapy.spectrum

Just wondered if the implementation seems roughly OK to you/if there is anything missing or that should obviously be changed?

Contributor

ellisowen commented Jun 18, 2014

Implements as we discussed yesterday - seems to give consistent conversion between integral and differential fluxes and back again. Still need to check whether the actual values are correct though.

I still need to:

  • Add an example
  • Add unit tests
  • Update docstrings
  • Change syntax to be consistent with that used in gammapy.spectrum

Just wondered if the implementation seems roughly OK to you/if there is anything missing or that should obviously be changed?

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 19, 2014

Contributor

Still working on example & some unit tests.

Contributor

ellisowen commented Jun 19, 2014

Still working on example & some unit tests.

Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 24, 2014

Contributor

There are still a couple of minor things I need to sort out. Will do this later today (& will also squash commits then too)

Contributor

ellisowen commented Jun 24, 2014

There are still a couple of minor things I need to sort out. Will do this later today (& will also squash commits then too)

@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jun 24, 2014

Contributor

The unit test test_compute_differential_flux_points() currently fails due to insufficient info about published data points it compares to i.e powerlaw index/spectral model/how energies are calculated in bins (although the values aren't wildly off). I guess comparison against a better understood dataset is the way forward here? Any suggestions of any?

Otherwise, can you please review?

Contributor

ellisowen commented Jun 24, 2014

The unit test test_compute_differential_flux_points() currently fails due to insufficient info about published data points it compares to i.e powerlaw index/spectral model/how energies are calculated in bins (although the values aren't wildly off). I guess comparison against a better understood dataset is the way forward here? Any suggestions of any?

Otherwise, can you please review?

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 24, 2014

Member

I'll have a look tomorrow. Can you please rebase this via git rebase master and then after resolving the conflicts force push this branch again to Github.

Member

cdeil commented Jun 24, 2014

I'll have a look tomorrow. Can you please rebase this via git rebase master and then after resolving the conflicts force push this branch again to Github.

Show outdated Hide outdated gammapy/spectrum/__init__.py Outdated
Show outdated Hide outdated gammapy/spectrum/utils.py Outdated
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jun 25, 2014

Member

Please have a look at the coverage of flux_points.py and add unit tests for the red lines (most importantly y_method == 'Model' is not tested at the moment):

python setup.py test --coverage
open htmlcov/index.html 
Member

cdeil commented Jun 25, 2014

Please have a look at the coverage of flux_points.py and add unit tests for the red lines (most importantly y_method == 'Model' is not tested at the moment):

python setup.py test --coverage
open htmlcov/index.html 
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated examples/flux_point.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated docs/tutorials/flux_point_model.py Outdated
Show outdated Hide outdated docs/tutorials/flux_point_plaw.py Outdated
Show outdated Hide outdated docs/tutorials/flux_point_plaw.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated docs/tutorials/flux_point_demo.py Outdated
Show outdated Hide outdated docs/tutorials/flux_point_model.py Outdated
@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 1, 2014

Member

Here's the analytical check where the point should go for power-laws we just coded together:
http://nbviewer.ipython.org/gist/cdeil/ff29110c1257fde3e06a

Member

cdeil commented Jul 1, 2014

Here's the analytical check where the point should go for power-laws we just coded together:
http://nbviewer.ipython.org/gist/cdeil/ff29110c1257fde3e06a

Begins implementation of Lafferty and Wyatt flux point method and API…
… changes to flux_point.py

Adds xfail test command to added unit test
@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jul 2, 2014

Contributor

How does this look?

Contributor

ellisowen commented Jul 2, 2014

How does this look?

Show outdated Hide outdated docs/tutorials/flux_point.rst Outdated
Show outdated Hide outdated docs/tutorials/flux_point.rst Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated gammapy/spectrum/flux_point.py Outdated
Show outdated Hide outdated docs/tutorials/flux_point.rst Outdated
Show outdated Hide outdated docs/tutorials/flux_point.rst Outdated
@ellisowen

This comment has been minimized.

Show comment
Hide comment
@ellisowen

ellisowen Jul 10, 2014

Contributor

Please can you review?

Contributor

ellisowen commented Jul 10, 2014

Please can you review?

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil

cdeil Jul 10, 2014

Member

Thanks!

Member

cdeil commented Jul 10, 2014

Thanks!

cdeil added a commit that referenced this pull request Jul 10, 2014

@cdeil cdeil merged commit 6110eca into gammapy:master Jul 10, 2014

1 check failed

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

@ellisowen ellisowen deleted the ellisowen:flux_point_method branch Jul 10, 2014

@cdeil

This comment has been minimized.

Show comment
Hide comment
@cdeil
Member

cdeil commented Jul 19, 2014

@cdeil cdeil changed the title from Flux point method to Add flux point computation using Lafferty & Wyatt (1995) Apr 8, 2015

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