LightCurveEstimator

class gammapy.estimators.LightCurveEstimator(time_intervals=None, source=0, energy_edges=None, atol='1e-6 s', 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

Estimate light curve.

The estimator will fit the source model component to datasets in each of the provided time intervals.

If no time intervals are provided, the estimator will use the time intervals defined by the datasets GTIs.

To be included in the estimation, the dataset must have their GTI fully overlapping a time interval.

Parameters
time_intervalslist of astropy.time.Time

Start and stop time for each interval to compute the LC

sourcestr

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

energy_edgesQuantity

Energy edges of the light curve.

atolQuantity

Tolerance value for time comparison with different scale. Default 1e-6 sec.

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

reoptimize other parameters during fit statistic scan?

selection_optionallist of str

Which steps to execute. Available options are:

  • “errn-errp”: estimate asymmetric errors.

  • “ul”: estimate upper limits.

  • “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_time_bin_flux(datasets)

Estimate flux point for a single energy group.

get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

run(datasets)

Run light curve extraction.

Attributes Documentation

config_parameters

Config parameters

selection_optional
tag = 'LightCurveEstimator'

Methods Documentation

copy()

Copy estimator

estimate_time_bin_flux(datasets)[source]

Estimate flux point for a single energy group.

Parameters
datasetsDatasets

the list of dataset object

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 light curve extraction.

Normalize integral and energy flux between emin and emax.

Parameters
datasetslist of SpectrumDataset or MapDataset

Spectrum or Map datasets.

Returns
lightcurveLightCurve

the Light Curve object