gammapy icon indicating copy to clipboard operation
gammapy copied to clipboard

Computation of the WcsMap kernel at the nearest valid exposure

Open bkhelifi opened this issue 2 years ago • 2 comments

Description

This pull request fixes the bug mentioned in the Issue #3707. It changes the computation of the kernel, previously done with the exposure at the centre of the map and now with the mean non-null exposure over the whole map.

Dear reviewer In addition to the change of the computation logics, I have added a test on the kernel values and also a test with a map with bins with null exposure.

bkhelifi avatar Jul 01 '22 15:07 bkhelifi

Codecov Report

Merging #4018 (bcbb55b) into master (48704e1) will decrease coverage by 0.00%. The diff coverage is 92.85%.

@@            Coverage Diff             @@
##           master    #4018      +/-   ##
==========================================
- Coverage   94.04%   94.04%   -0.01%     
==========================================
  Files         162      162              
  Lines       21444    21455      +11     
==========================================
+ Hits        20167    20177      +10     
- Misses       1277     1278       +1     
Impacted Files Coverage Δ
gammapy/datasets/utils.py 84.00% <85.71%> (+0.66%) :arrow_up:
gammapy/estimators/map/ts.py 97.70% <100.00%> (+0.03%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Jul 04 '22 15:07 codecov[bot]

Idea from dev meeting today: make behavior consistent with IRF kernel extraction. So find the nearest valid position to extract the exposure from. I think for a TS map we always need a PSF, so we could use:

datasets.psf._get_nearest_valid_position(position=, )

It's not ideal to rely on a hidden method, but as we do it internally in Gammapy it's acceptable.

adonath avatar Jul 08 '22 18:07 adonath