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 PSF3D.to_energy_dependent_table_psf #1268

Merged
merged 2 commits into from Jan 30, 2018
Merged

Fix PSF3D.to_energy_dependent_table_psf #1268

merged 2 commits into from Jan 30, 2018

Conversation

@cdeil
Copy link
Member

@cdeil cdeil commented Jan 30, 2018

The PSF3D.to_energy_dependent_table_psf method is broken, i.e. it's not possible to do PSF containment correction in spectral analysis for the HESS data (cc @lmohrmann)

apply_containment_correction
    psf = obs.psf.to_energy_dependent_table_psf(theta=offset)
  File "/Users/deil/code/gammapy/gammapy/irf/psf_3d.py", line 239, in to_energy_dependent_table_psf
    psf_value = self.evaluate(offset=theta).quantity[0].T
  File "/Users/deil/Library/Python/3.6/lib/python/site-packages/astropy/units/quantity.py", line 988, in __getattr__
    attr))
AttributeError: 'Quantity' object has no 'quantity' member

I plan to make a PR to fix this and to generally improve that class and test coverage tonight.

@cdeil cdeil added the bug label Jan 29, 2018
@cdeil cdeil added this to the 0.7 milestone Jan 29, 2018
@cdeil cdeil self-assigned this Jan 29, 2018
@cdeil
Copy link
Member Author

@cdeil cdeil commented Jan 30, 2018

I've implemented a fix and test in b567349 as well as done some misc improvements of PSF3D code and tests. I did not go the step and re-write it to use NDData here.
The fix is the removal of the .quantity here:
https://github.com/gammapy/gammapy/pull/1268/files#diff-b46a627bbef4a5b8a17c6440a21f5dbaL239

I'll merge this if tests pass.

@cdeil cdeil force-pushed the cdeil:1268 branch from b567349 to 2e3a2d0 Jan 30, 2018
@cdeil cdeil merged commit b61ed93 into gammapy:master Jan 30, 2018
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant