You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
Running to_spectrum_dataset() on a Mapdataset with a background model produces a spectrum dataset, that is constructed with just the IRF bkg and not the fitted model.
Expected behavior
It should take the fit into account. This is the case, when the mapdataset is first stacked / to_masked is run, because then the model is correctly applied.
Gammapy version
1.1, 1.2
Bug description
Running
to_spectrum_dataset()
on aMapdataset
with a background model produces a spectrum dataset, that is constructed with just the IRF bkg and not the fitted model.Expected behavior
It should take the fit into account. This is the case, when the mapdataset is first stacked /
to_masked
is run, because then the model is correctly applied.Compare these two code pieces:
gammapy/gammapy/datasets/map.py
Lines 1009 to 1017 in 86488ec
gammapy/gammapy/datasets/map.py
Lines 1783 to 1787 in 86488ec
As the
background
does not know of the model, it is not applied.From my understanding of the intended behavior, the first case is correct and the second one should be fixed.
The text was updated successfully, but these errors were encountered: