Fit mask overridden in FoVBackgroundMaker and FluxPointsEstimator
See original GitHub issueGammapy version dev
Bug description See:
- https://github.com/gammapy/gammapy/blob/9df7a783fc050cf79667deb94d0cc635a2aa5bfb/gammapy/makers/background/fov.py#L49
- https://github.com/gammapy/gammapy/blob/9df7a783fc050cf79667deb94d0cc635a2aa5bfb/gammapy/estimators/flux_point.py#L906
The dataset.mask_fit
if overridden during the computation of flux points or the field of view background normalization. This is bad, because users might want e.g. to:
- normalize the background in a custom energy range
- compute flux points by masking away some map regions
In those cases, they would set a dataset.mask_fit
that is silently overridden in the current code. Notice that, for the case of background normalization in a custom energy range, this issue can be overcome by adapting the exclusion mask, instead of touching the dataset.mask_fit
. But still, it is legitimate to want to do it with the dataset.mask_fit
so it shouldn’t be overridden.
Other information I didn’t check if this issue is also present somewhere else in the gammapy code, it might be worth having a look
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Unify mask handling in Dataset methods and Estimators #3031
FoVBackgroundMaker : just uses the exclusion_mask parameter, see Fit mask overridden in FoVBackgroundMaker and FluxPointsEstimator #2921.
Read more >FoVBackgroundMaker — gammapy vX.Y.Z
The normalization is performed outside the exclusion mask that is passed on init. This also internally takes into account the dataset fit mask....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@luca-giunti I can’t remember the reasoning either. But looking at this again I think overriding the
mask_fit
internally is maybe not the best solution. Probably it would make more sense to to keep themask_fit
and combine it internally with theexclusion_mask
.@luca-giunti I think the conclusion from the last dev call here was, to handle everything with the
exclusion_mask
. Is this correct?