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 2 commits into from Jan 30, 2018


None yet
1 participant

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)

    psf = obs.psf.to_energy_dependent_table_psf(theta=offset)
  File "/Users/deil/code/gammapy/gammapy/irf/", 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/", line 988, in __getattr__
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


This comment has been minimized.


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:

I'll merge this if tests pass.

@cdeil cdeil merged commit b61ed93 into gammapy:master Jan 30, 2018

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
continuous-integration/travis-ci/pr The Travis CI build is in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment