LightCurve

class gammapy.time.LightCurve(data=None, masked=None, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, **kwargs)[source]

Bases: astropy.table.QTable

LightCurve class.

Contains all data in the tabular form with columns tstart, tstop, flux, flux error, time bin (opt). Possesses functions allowing plotting data, saving as txt and elementary stats like mean & std dev.

TODO: specification of format is work in progress See https://github.com/open-gamma-ray-astro/gamma-astro-data-formats/pull/61

Methods Summary

compute_chisq() Calculate the chi-square test for LightCurve.
compute_fvar() Calculate the fractional excess variance.
plot([ax]) Plot flux versus time.
simulate_example() Simulate an example LightCurve.

Methods Documentation

compute_chisq()[source]

Calculate the chi-square test for LightCurve.

Chisquare test is a variability estimator. It computes deviations from the expected value here mean value

Returns:

ChiSq, P-value : tuple of float or ndarray

Tuple of Chi-square and P-value

compute_fvar()[source]

Calculate the fractional excess variance.

This method accesses the the FLUX and FLUX_ERR columns from the lightcurve data.

The fractional excess variance \(F_{var}\), an intrinsic variability estimator, is given by

\[F_{var} = \sqrt{\frac{S^{2} - \bar{\sigma^{2}}}{\bar{x}^{2}}}.\]

It is the excess variance after accounting for the measurement errors on the light curve \(\sigma\). \(S\) is the variance.

Returns:

fvar, fvar_err : numpy.array

Fractional excess variance.

References

[Vaughan2003]“On characterizing the variability properties of X-ray light curves from active galaxies”, Vaughan et al. (2003) http://adsabs.harvard.edu/abs/2003MNRAS.345.1271V
plot(ax=None)[source]

Plot flux versus time.

Parameters:

ax : Axes or None, optional.

The Axes object to be drawn on. If None, uses the current Axes.

Returns:

ax : Axes or None, optional.

The Axes object to be drawn on. If None, uses the current Axes.

classmethod simulate_example()[source]

Simulate an example LightCurve.

TODO: add options to simulate some more interesting lightcurves.