time - Time analysis¶
gammapy.time contains classes and methods for time-based analysis, e.g. for AGN, binaries
or pulsars studies. The main classes are
LightCurve, which is a container for
light curves, and
LightCurveEstimator, which extracts a light curve from a list
of datasets. A number of functions to test for variability and periodicity are available in
contains low-level helper functions for time conversions.
Variability and periodicity tests¶
A few utility functions to perform timing tests are available in
compute_chisq performs a chisquare test for variable source flux:
>>> from gammapy.time import chisquare >>> print(compute_chisq(lc['FLUX']))
compute_fvar calculates the fractional variance excess:
>>> from gammapy.time import fvar >>> print(compute_fvar(lc['FLUX'], lc['FLUX_ERR']))
time also provides methods for period detection in time series, i.e. light
curves of \(\gamma\)-ray sources.
robust_periodogram performs a
periodogram analysis where the unevenly sampled time series is contaminated by outliers,
i.e. due to the source’s high states. This is demonstrated on the Period detection and plotting page.
The main tutorial demonstrates how to extract light curves from 1D and 3D datasets:
Light curve extraction on small time bins (i.e. smaller than the observation scale) for flares is demonstrated in the following tutorial:
Calculate the chi-square test for
Calculate the fractional excess variance.
Plot a light curve and its periodogram.
Compute a light curve’s period.