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

Improve SkyCube energy axes #759

Merged
merged 8 commits into from Nov 10, 2016
Merged

Conversation

@adonath
Copy link
Member

@adonath adonath commented Nov 9, 2016

This PR is the second part of a major rework of the SkyCube class. These are the mos important changes:

  • Rename SkyCube.integral_flux_image() to SkyCube.sky_image_integral(), and reimplement the method using _trapz_loglog.
  • Add the interpolation options back and modify the interpolation to work in log-log
  • Introduce the format options 'fermi-counts', 'fermi-background' and 'fermi-exposure'in SkyCube.read(), because in the previous implementation units and energy ranges were not read and set correctly.
  • Replace SkyCube.energy by SkyCube.energies() which has the options 'center' and 'edges'. This was done because the former SkyCube.energy was not well defined. In some cases it represented the edges in some cases the centers.
  • Minor: Rename SkyCube.ref_sky_image to SkyCube.sky_image_ref. This has the advantage that all sky image related properties and methods start with sky_image_... and will be listed by tab completion.
  • Add more interpolation and reprojection tests in general
@adonath adonath force-pushed the adonath:rework_cube_energy_axes branch from 01109dd to b118c02 Nov 9, 2016
@cdeil cdeil added this to the 0.5 milestone Nov 9, 2016
@cdeil
Copy link
Member

@cdeil cdeil commented Nov 9, 2016

There's one test fail that's probably related to this PR:
https://travis-ci.org/gammapy/gammapy/jobs/174551958#L979

Otherwise: 👍 to merge.
(I didn't review it and don't have time this week.)

@adonath
Copy link
Member Author

@adonath adonath commented Nov 10, 2016

The remaining test fails will be fixed with gammapy/gammapy-extra#42.

@leajouvin Please note that this PR changes the fit results from the sherpa cube fit notebook, because of a fixed bug in the energy boundary computation, when SkyCube is transformed to the sherpa data object. It might affect your analysis results as well.

@JouvinLea
Copy link

@JouvinLea JouvinLea commented Nov 10, 2016

@adonath
I don't see really the difference between what you implemented and what was before. I mean in my script I am already giving the edges for the energy bin so there was no bug no?

@adonath
Copy link
Member Author

@adonath adonath commented Nov 10, 2016

@leajouvin Yes, depending on how you gave the energy binning to the cube or read it from file, it might give different results or not. It did for the sherpa cube analysis notebook. I just wanted to make you aware of this change, in case you see any issues with your analysis.

@adonath adonath merged commit 2c6faf6 into gammapy:master Nov 10, 2016
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@adonath adonath deleted the adonath:rework_cube_energy_axes branch Nov 10, 2016
@adonath adonath mentioned this pull request Nov 14, 2016
6 of 8 tasks
@cdeil cdeil changed the title Rework cube energy axes Improve SkyCube energy axes Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants