LightCurveEstimator

class gammapy.time.LightCurveEstimator(datasets, 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

Estimate flux points for a given list of datasets, each per time bin.

Parameters:
datasets : list of SpectrumDataset or MapDataset

Spectrum or Map datasets.

source : str

For which source in the model to compute the flux points. Default is ‘’

norm_min : float

Minimum value for the norm used for the likelihood profile evaluation.

norm_max : float

Maximum value for the norm used for the likelihood profile evaluation.

norm_n_values : int

Number of norm values used for the likelihood profile.

norm_values : numpy.ndarray

Array of norm values to be used for the likelihood profile.

sigma : int

Sigma to use for asymmetric error computation.

sigma_ul : int

Sigma to use for upper limit computation.

reoptimize : bool

reoptimize other parameters during likelihod scan

Attributes Summary

ref_model

Methods Summary

estimate_counts(self, dataset) Estimate counts for the flux point.
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 likelihood profile for the norm parameter.
estimate_norm_ts(self) Estimate ts and sqrt(ts) for the flux point.
estimate_norm_ul(self, dataset) Estimate upper limit for a flux point.
estimate_time_bin_flux(self, dataset[, steps]) Estimate flux point for a single energy group.
run(self, e_ref, e_min, e_max[, steps]) Run light curve extraction.

Attributes Documentation

ref_model

Methods Documentation

estimate_counts(self, dataset)[source]

Estimate counts for the flux point.

Parameters:
dataset : Dataset

the dataset object

Returns:
result : dict

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

estimate_norm(self)[source]

Fit norm of the flux point.

Returns:
result : dict

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

estimate_norm_err(self)[source]

Estimate covariance errors for a flux point.

Returns:
result : dict

Dict with symmetric error for the flux point norm.

estimate_norm_errn_errp(self)[source]

Estimate asymmetric errors for a flux point.

Returns:
result : dict

Dict with asymmetric errors for the flux point norm.

estimate_norm_scan(self)[source]

Estimate likelihood profile for the norm parameter.

Returns:
result : dict

Dict with norm_scan and dloglike_scan for the flux point.

estimate_norm_ts(self)[source]

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

Returns:
result : dict

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

estimate_norm_ul(self, dataset)[source]

Estimate upper limit for a flux point.

Returns:
result : dict

Dict with upper limit for the flux point norm.

estimate_time_bin_flux(self, dataset, steps='all')[source]

Estimate flux point for a single energy group.

Parameters:
steps : list 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 likelihood profiles.

By default all steps are executed.

Returns:
result : dict

Dict with results for the flux point.

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

Run light curve extraction.

Normalize integral and energy flux between emin and emax.

Parameters:
e_ref : Quantity

reference energy of dnde flux normalization

e_min : Quantity

minimum energy of integral and energy flux normalization interval

e_max : Quantity

minimum energy of integral and energy flux normalization interval

steps : list 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 likelihood profiles.

By default all steps are executed.

Returns:
lightcurve : LightCurve

the Light Curve object