LightCurveEstimator

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

Compute light curve.

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

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
datasetslist of SpectrumDataset or MapDataset

Spectrum or Map datasets.

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 ‘’

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

reoptimize other parameters during fit statistic scan?

Attributes Summary

ref_model

Methods Summary

estimate_counts(self, datasets)

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 fit statistic profile for the norm parameter.

estimate_norm_ts(self, datasets)

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

estimate_norm_ul(self, datasets)

Estimate upper limit for a flux point.

estimate_time_bin_flux(self, datasets, …)

Estimate flux point for a single energy group.

run(self, e_ref, e_min, e_max[, steps, atol])

Run light curve extraction.

Attributes Documentation

ref_model

Methods Documentation

estimate_counts(self, datasets)[source]

Estimate counts for the flux point.

Parameters
datasetsDatasets

the list of dataset object

Returns
resultdict

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

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

Parameters
datasetsDatasets

the list of dataset object

Returns
resultdict

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

estimate_norm_ul(self, datasets)[source]

Estimate upper limit for a flux point.

Parameters
datasetsDatasets

the list of dataset object

Returns
resultdict

Dict with upper limit for the flux point norm.

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

Estimate flux point for a single energy group.

Parameters
datasetsDatasets

the list of dataset object

time_intervalastropy.time.Time`

Start and stop time for each interval

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 likelihood profiles.

By default all steps are executed.

Returns
resultdict

Dict with results for the flux point.

run(self, e_ref, e_min, e_max, steps='all', atol='1e-6 s')[source]

Run light curve extraction.

Normalize integral and energy flux between emin and emax.

Parameters
e_refQuantity

reference energy of dnde flux normalization

e_minQuantity

minimum energy of integral and energy flux normalization interval

e_maxQuantity

minimum energy of integral and energy flux normalization interval

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.

atolQuantity

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

Returns
lightcurveLightCurve

the Light Curve object