FluxCollectionEstimator#

class gammapy.estimators.FluxCollectionEstimator[source]#

Bases: object

Estimate the flux points from a collection of sources simultaneously.

This estimator computes spectral flux points for a collection of sources over a set of predefined energy bins. The normalisations of all SkyModel objects listed in models are fitted jointly in each energy bin, while all other SkyModel components in the datasets remain frozen. Re-optimization of each dataset’s background model is optional.

The operation can be performed either with the standard likelihood optimizer (Fit) or with a sampler (Sampler), which can be used to derive asymmetric errors and upper limits.

By default, this requires the ultranest package to be installed.

Parameters:
energy_edgesQuantity

Energy edges of the flux point bins.

modelsModels or list

Source models for which the flux points are computed (others are frozen).

n_sigmafloat, optional

Number of sigma to use for asymmetric error computation. Must be a positive value. Default is 1.

n_sigma_ulfloat, optional

Number of sigma to use for upper limit computation. Must be a positive value. Default is 2.

normParameter, optional

Norm parameter used for the fit. Default is None and a new parameter is created with value=1, name=”norm”. If the solver is a sampler the default prior is uniform between [-10, 10].

solverFit or Sampler, optional

Fit or Sampler instance specifying the backend and options. Default is a Sampler with options live_points=300, frac_remain=0.3.

reoptimizebool, optional

Whether to reoptimize each dataset.background_model. Default is False. Only SkyModel given in models will be fitted the others remain frozen, regardless of this option.

selection_optionallist of str, optional
Which additional quantities to estimate. Available options are:
  • “errn-errp”: estimate asymmetric errors on flux.

Fit solver computes upper limits if sqrt(TS) < n_sigma_ul. Sampler solver always compute errn-errp and ul.

Attributes Summary

tag

Methods Summary

run(datasets)

Compute flux point in each energy band.

Attributes Documentation

tag = 'FluxCollectionEstimator'#

Methods Documentation

run(datasets)[source]#

Compute flux point in each energy band.

Parameters:
datasetsDatasets

Datasets used to compute the flux points. They must share the same geometry.

Returns:
resultdict

Dictionary with results

__init__(energy_edges, models, n_sigma=1, n_sigma_ul=2, norm=None, solver=None, reoptimize=False, selection_optional=None)[source]#
classmethod __new__(*args, **kwargs)#