LightCurveEstimator

class gammapy.time.LightCurveEstimator(spec_extract)[source]

Bases: object

Light curve estimator.

For a usage example see light_curve.html.

Parameters:
spec_extract : SpectrumExtraction

Contains statistics, IRF and event lists

Methods Summary

compute_flux_point(time_interval, …[, …]) Compute one flux point for one time interval.
light_curve(time_intervals, spectral_model, …) Compute light curve.
make_time_intervals_fixes(time_step, …) Create time intervals of fixed size.
make_time_intervals_min_significance(…[, …]) Create time intervals such that each bin of a light curve reach a given significance

Methods Documentation

compute_flux_point(time_interval, spectral_model, energy_range, ul_significance=3)[source]

Compute one flux point for one time interval.

Parameters:
time_interval : Time

Time interval (2-element array, or a tuple of Time objects)

spectral_model : SpectralModel

Spectral model

energy_range : Quantity

True energy range to evaluate integrated flux (true energy)

ul_significance : float

Upper limit confidence level significance

Returns:
useinterval : bool

Is True if the time_interval produce a valid flux point

measurements : dict

Dictionary with flux point measurement in the time interval

light_curve(time_intervals, spectral_model, energy_range, ul_significance=3)[source]

Compute light curve.

Implementation follows what is done in: http://adsabs.harvard.edu/abs/2010A%26A…520A..83H.

To be discussed: assumption that threshold energy in the same in reco and true energy.

Parameters:
time_intervals : list of Time

List of time intervals

spectral_model : SpectralModel

Spectral model

energy_range : Quantity

True energy range to evaluate integrated flux (true energy)

ul_significance : float

Upper limit confidence level significance

Returns:
lc : LightCurve

Light curve

static make_time_intervals_fixes(time_step, spectrum_extraction)[source]

Create time intervals of fixed size.

Parameters:
time_step : float

Size of the light curve bins in seconds

spectrum_extraction : SpectrumExtraction

Contains statistics, IRF and event lists

Returns:
table : Table

Table of time intervals

Examples

To extract intervals for light curve:

intervals = list(zip(table['t_start'], table['t_stop']))
make_time_intervals_min_significance(significance, significance_method, energy_range, spectrum_extraction, separators=None)[source]

Create time intervals such that each bin of a light curve reach a given significance

The function work event by event to create an interval containing enough statistic and then starting a new one

Parameters:
significance : float

Target significance for each light curve point

significance_method : {‘lima’, ‘simple’}

Significance method (see significance_on_off)

energy_range : Quantity

True energy range to evaluate integrated flux (true energy)

spectrum_extraction : SpectrumExtraction

Contains statistics, IRF and event lists

separators : list of Time

Contains a list of time to stop the current point creation (not saved) and start a new one Mostly useful between observations separated by a large time gap

Returns:
table : Table

Table of time intervals and information about their content : on/off events, alpha, significance

Examples

extract intervals for light curve :
intervals = list(zip(table[‘t_start’], table[‘t_stop’]))