ExcessMapEstimator

class gammapy.estimators.ExcessMapEstimator(correlation_radius='0.1 deg', n_sigma=1, n_sigma_ul=3, selection_optional='all', energy_edges=None, apply_mask_fit=False)[source]

Bases: gammapy.estimators.Estimator

Computes correlated excess, sqrt TS (i.e. Li-Ma significance) and errors for MapDatasets.

If a model is set on the dataset the excess map estimator will compute the excess taking into account the predicted counts of the model.

Parameters
correlation_radius~astropy.coordinate.Angle

correlation radius to use

n_sigmafloat

Confidence level for the asymmetric errors expressed in number of sigma. Default is 1.

n_sigma_ulfloat

Confidence level for the upper limits expressed in number of sigma. Default is 3.

selection_optionallist of str

Which additional maps to estimate besides delta TS, significance and symmetric error. Available options are:

  • “errn-errp”: estimate asymmetric errors.

  • “ul”: estimate upper limits.

By default all additional quantities are estimated.

energy_edgesQuantity

Energy edges of the target excess maps bins.

apply_mask_fitBool

Apply a mask for the computation. A mask_fit must be present on the input dataset

Attributes Summary

config_parameters

Config parameters

correlation_radius

selection_optional

tag

Methods Summary

copy()

Copy estimator

estimate_excess_map(dataset)

Estimate excess and ts maps for single dataset.

get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

run(dataset)

Compute correlated excess, Li & Ma significance and flux maps

Attributes Documentation

config_parameters

Config parameters

correlation_radius
selection_optional
tag = 'ExcessMapEstimator'

Methods Documentation

copy()

Copy estimator

estimate_excess_map(dataset)[source]

Estimate excess and ts maps for single dataset.

If exposure is defined, a flux map is also computed.

Parameters
datasetMapDataset

Map dataset

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]

Compute correlated excess, Li & Ma significance and flux maps

If a model is set on the dataset the excess map estimator will compute the excess taking into account the predicted counts of the model.

Parameters
datasetMapDataset or MapDatasetOnOff

input dataset

Returns
imagesdict

Dictionary containing result correlated maps. Keys are:

  • counts : correlated counts map

  • background : correlated background map

  • excess : correlated excess map

  • ts : TS map

  • sqrt_ts : sqrt(delta TS), or Li-Ma significance map

  • err : symmetric error map (from covariance)

  • flux : flux map. An exposure map must be present in the dataset to compute flux map

  • errn : negative error map

  • errp : positive error map

  • ul : upper limit map