FluxPointsEstimator

class gammapy.estimators.FluxPointsEstimator(energy_edges=<Quantity [ 1., 10.] TeV>, source=0, norm_min=0.2, norm_max=5, norm_n_values=11, norm_values=None, n_sigma=1, n_sigma_ul=2, reoptimize=False, selection_optional='all')[source]

Bases: gammapy.estimators.Estimator

Flux points estimator.

Estimates flux points for a given list of datasets, energies and spectral model.

To estimate the flux point the amplitude of the reference spectral model is fitted within the energy range defined by the energy group. This is done for each group independently. The amplitude is re-normalized using the “norm” parameter, which specifies the deviation of the flux from the reference model in this energy group. See https://gamma-astro-data-formats.readthedocs.io/en/latest/spectra/binned_likelihoods/index.html for details.

The method is also described in the Fermi-LAT catalog paper https://ui.adsabs.harvard.edu/#abs/2015ApJS..218…23A or the HESS Galactic Plane Survey paper https://ui.adsabs.harvard.edu/#abs/2018A%26A…612A…1H

Parameters
energy_edgesQuantity

Energy edges of the flux point bins.

sourcestr or int

For which source in the model to compute the flux points.

norm_minfloat

Minimum value for the norm used for the fit statistic profile evaluation.

norm_maxfloat

Maximum value for the norm used for the fit statistic profile evaluation.

norm_n_valuesint

Number of norm values used for the fit statistic profile.

norm_valuesnumpy.ndarray

Array of norm values to be used for the fit statistic profile.

n_sigmaint

Number of sigma to use for asymmetric error computation. Default is 1.

n_sigma_ulint

Number of sigma to use for upper limit computation. Default is 2.

reoptimizebool

Re-optimize other free model parameters.

selection_optionallist of str

Which additional quantities to estimate. Available options are:

  • “errn-errp”: estimate asymmetric errors on flux.

  • “ul”: estimate upper limits.

  • “norm-scan”: estimate fit statistic profiles.

By default all steps are executed.

Attributes Summary

config_parameters

Config parameters

selection_optional

tag

Methods Summary

copy()

Copy estimator

estimate_counts(datasets, energy_min, energy_max)

Estimate counts for the flux point.

estimate_flux_point(datasets, energy_min, …)

Estimate flux point for a single energy group.

get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

run(datasets)

Run the flux point estimator for all energy groups.

Attributes Documentation

config_parameters

Config parameters

selection_optional
tag = 'FluxPointsEstimator'

Methods Documentation

copy()

Copy estimator

static estimate_counts(datasets, energy_min, energy_max)[source]

Estimate counts for the flux point.

Parameters
datasetsDatasets

Datasets

energy_min, energy_maxQuantity

Energy bounds to compute the flux point for.

Returns
resultdict

Dict with an array with one entry per dataset with counts for the flux point.

estimate_flux_point(datasets, energy_min, energy_max)[source]

Estimate flux point for a single energy group.

Parameters
datasetsDatasets

Datasets

energy_min, energy_maxQuantity

Energy bounds to compute the flux point for.

Returns
resultdict

Dict with results for the flux point.

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(datasets)[source]

Run the flux point estimator for all energy groups.

Parameters
datasetslist of Dataset

Datasets

Returns
flux_pointsFluxPoints

Estimated flux points.