excess_matching_significance_on_off

gammapy.stats.excess_matching_significance_on_off(n_off, alpha, significance, method='lima')[source]

Compute sensitivity of an on-off observation.

This function is the inverse of significance_on_off.

Parameters
n_offarray_like

Observed number of counts in the off region

alphaarray_like

On / off region exposure ratio for background events

significancearray_like

Desired significance level

method{‘lima’, ‘simple’}

Which method?

Returns
excessnumpy.ndarray

Excess

Examples

>>> excess_matching_significance_on_off(n_off=20,alpha=0.1,significance=5,method='lima')
12.038
>>> excess_matching_significance_on_off(n_off=20,alpha=0.1,significance=5,method='simple')
27.034
>>> excess_matching_significance_on_off(n_off=20,alpha=0.1,significance=0,method='lima')
2.307301461e-09
>>> excess_matching_significance_on_off(n_off=20,alpha=0.1,significance=0,method='simple')
0.0
>>> excess_matching_significance_on_off(n_off=20,alpha=0.1,significance=-10,method='lima')
nan
>>> excess_matching_significance_on_off(n_off=20,alpha=0.1,significance=-10,method='simple')
nan