FluxPointsEstimator

class gammapy.spectrum.FluxPointsEstimator(datasets, e_edges, source='', norm_min=0.2, norm_max=5, norm_n_values=11, norm_values=None, sigma=1, sigma_ul=2, reoptimize=False)[source]

Bases: object

Flux points estimator.

Estimates flux points for a given list of spectral 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
datasetslist of SpectrumDataset

Spectrum datasets.

e_edgesQuantity

Energy edges of the flux point bins.

sourcestr

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.

sigmaint

Sigma to use for asymmetric error computation.

sigma_ulint

Sigma to use for upper limit computation.

reoptimizebool

Re-optimize other free model parameters.

Attributes Summary

e_groups

Energy grouping table Table

ref_model

Methods Summary

estimate_counts(self)

Estimate counts for the flux point.

estimate_flux_point(self, e_group[, steps])

Estimate flux point for a single energy group.

estimate_norm(self)

Fit norm of the flux point.

estimate_norm_err(self)

Estimate covariance errors for a flux point.

estimate_norm_errn_errp(self)

Estimate asymmetric errors for a flux point.

estimate_norm_scan(self)

Estimate fit statistic profile for the norm parameter.

estimate_norm_ts(self)

Estimate ts and sqrt(ts) for the flux point.

estimate_norm_ul(self)

Estimate upper limit for a flux point.

run(self[, steps])

Run the flux point estimator for all energy groups.

Attributes Documentation

e_groups

Energy grouping table Table

ref_model

Methods Documentation

estimate_counts(self)[source]

Estimate counts for the flux point.

Returns
resultdict

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

estimate_flux_point(self, e_group, steps='all')[source]

Estimate flux point for a single energy group.

Parameters
e_groupRow

Energy group to compute the flux point for.

stepslist of str

Which steps to execute. Available options are:

  • “err”: estimate symmetric error.

  • “errn-errp”: estimate asymmetric errors.

  • “ul”: estimate upper limits.

  • “ts”: estimate ts and sqrt(ts) values.

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

By default all steps are executed.

Returns
resultdict

Dict with results for the flux point.

estimate_norm(self)[source]

Fit norm of the flux point.

Returns
resultdict

Dict with “norm” and “stat” for the flux point.

estimate_norm_err(self)[source]

Estimate covariance errors for a flux point.

Returns
resultdict

Dict with symmetric error for the flux point norm.

estimate_norm_errn_errp(self)[source]

Estimate asymmetric errors for a flux point.

Returns
resultdict

Dict with asymmetric errors for the flux point norm.

estimate_norm_scan(self)[source]

Estimate fit statistic profile for the norm parameter.

Returns
resultdict

Keys: “norm_scan”, “stat_scan”

estimate_norm_ts(self)[source]

Estimate ts and sqrt(ts) for the flux point.

Returns
resultdict

Dict with ts and sqrt(ts) for the flux point.

estimate_norm_ul(self)[source]

Estimate upper limit for a flux point.

Returns
resultdict

Dict with upper limit for the flux point norm.

run(self, steps='all')[source]

Run the flux point estimator for all energy groups.

Returns
flux_pointsFluxPoints

Estimated flux points.

stepslist of str

Which steps to execute. See estimate_flux_point for details and available options.