SensitivityEstimator

class gammapy.estimators.SensitivityEstimator(spectrum=None, n_sigma=5.0, gamma_min=10, bkg_syst_fraction=0.05)[source]

Bases: gammapy.estimators.Estimator

Estimate differential sensitivity.

This class allows to determine for each reconstructed energy bin the flux associated to the number of gamma-ray events for which the significance is n_sigma, and being larger than gamma_min and bkg_sys percent larger than the number of background events in the ON region.

Parameters
spectrumSpectralModel

Spectral model assumption

n_sigmafloat, optional

Minimum significance. Default is 5.

gamma_minfloat, optional

Minimum number of gamma-rays. Default is 10.

bkg_syst_fractionfloat, optional

Fraction of background counts above which the number of gamma-rays is. Default is 0.05

Examples

For a usage example see cta_sensitivity.html

Attributes Summary

config_parameters

Config parameters

selection_optional

tag

Methods Summary

copy()

Copy estimator

estimate_min_e2dnde(excess, dataset)

Estimate dnde from given min.

estimate_min_excess(dataset)

Estimate minimum excess to reach the given significance.

get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

run(dataset)

Run the sensitivty estimation

Attributes Documentation

config_parameters

Config parameters

selection_optional
tag = 'SensitivityEstimator'

Methods Documentation

copy()

Copy estimator

estimate_min_e2dnde(excess, dataset)[source]

Estimate dnde from given min. excess

Parameters
excessRegionNDMap

Minimal excess

datasetSpectrumDataset

Spectrum dataset

Returns
e2dndeQuantity

Minimal differential flux.

estimate_min_excess(dataset)[source]

Estimate minimum excess to reach the given significance.

Parameters
datasetSpectrumDataset

Spectrum dataset

Returns
excessRegionNDMap

Minimal excess

static get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

Compute sqrt(TS) as defined by:

\[\begin{split}\sqrt{TS} = \left \{ \begin{array}{ll} -\sqrt{TS} & : \text{if} \ norm < 0 \\ \sqrt{TS} & : \text{else} \end{array} \right.\end{split}\]
Parameters
tsndarray

TS value.

normndarray

norm value

Returns
——-
sqrt_tsndarray

Sqrt(TS) value.

run(dataset)[source]

Run the sensitivty estimation

Parameters
datasetSpectrumDatasetOnOff

Dataset to compute sensitivty for.

Returns
sensitivityTable

Sensitivity table