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.

Behaviour of `ExcessMapEstimator`

See original GitHub issue

Currently, the ExcessMapEstimator behaves differently for MapDataset and MapDatasetOnOff. In the first case, the npred is taken as the background - ie, the background and the source models are both considered. In the second case, only the counts_off and the background are considered, and the counts from the source ignored.

This is quite confusing. We should enforce similar behaviour, and I think that the npred should be considered in case of MapDatasetOnOff as well. What do you think @registerrier @adonath ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
registerriercommented, Aug 27, 2020

I think we should make things uniform with SpectrumDatasetOnOff where we have a npred_sig that focuses only on the model npred. And then indeed we could modify background so that it returns the background taking into account the model and possibly add an npred that would return background + npred_sig.

0reactions
adonathcommented, Aug 28, 2020

Here is the conclusion / action items how to unify the behaviour:

  • Modify both SpectrumDatasetOnOff.backgroud and MapDatasetOnOff.background to return the expected (marginalised) background using get_wstat_mu_bkg()
  • Introduce MapDatasetOnOff.npred_sig() and modify MapDatastOnOff.npred() to add the background component

I would proposed to add an optional mu_bkg argument to WStatCountsStatistic in a separate PR. I still need to make up my mind about the details…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unify mask handling in Dataset methods and Estimators #3031
Here is the current behaviour: Dataset methods: ... ExcessMapEstimator : takes mask_safe into account, optionally the mask_fit as well ...
Read more >
gammapy vX.Y.Z - assert_quantity_allclose
Assert all-close for astropy.units.Quantity objects. Requires that unit is identical, not just that quantities are allclose taking different units into account.
Read more >
The Origin of Galactic TeV Gamma Ray Sources
The behaviour of a power law means the CR flux decreases rapidly as energy ... We utilise the ExcessMapEstimator class which calculates the ......
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