background_error

gammapy.stats.background_error(n_off, alpha)[source]

Estimate standard error on background in the on region from an off-region observation.

\[\Delta\mu_{bkg} = \alpha \times \sqrt{n_{off}}\]
Parameters
n_offarray_like

Observed number of counts in the off region

alphaarray_like

On / off region exposure ratio for background events

Returns
backgroundnumpy.ndarray

Background estimate for the on region

Examples

>>> background_error(n_off=4, alpha=0.1)
0.2
>>> background_error(n_off=9, alpha=0.2)
0.6