question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fit mask overridden in FoVBackgroundMaker and FluxPointsEstimator

See original GitHub issue

Gammapy version dev

Bug description See:

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:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
adonathcommented, Dec 7, 2021

@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 the mask_fit and combine it internally with the exclusion_mask.

1reaction
adonathcommented, Oct 9, 2020

@luca-giunti I think the conclusion from the last dev call here was, to handle everything with the exclusion_mask. Is this correct?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found