LightCurve¶
-
class
gammapy.time.LightCurve(table)[source]¶ Bases:
objectLightcurve container.
The lightcurve data is stored in
table.For now we only support times stored in MJD format!
TODO: specification of format is work in progress See https://github.com/open-gamma-ray-astro/gamma-astro-data-formats/pull/61
Usage: Lightcurve
Parameters: table :
TableTable with lightcurve data
Attributes Summary
timeTime ( Time).time_deltaTime bin width ( TimeDelta).time_formatTime format (str). time_maxTime bin end ( Time).time_midTime bin center ( Time).time_minTime bin start ( Time).time_scaleTime scale (str). Methods Summary
compute_chisq()Calculate the chi-square test for LightCurve.compute_fvar()Calculate the fractional excess variance. plot([ax])Plot flux versus time. read(filename, **kwargs)Read from file. write(filename, **kwargs)Write to file. Attributes Documentation
-
time_format¶ Time format (str).
-
time_scale¶ Time scale (str).
Taken from table “TIMESYS” header. Common values: “TT” or “UTC”. Assumed default is “UTC”.
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
ndarrayTuple of Chi-square and P-value
-
compute_fvar()[source]¶ Calculate the fractional excess variance.
This method accesses the the
FLUXandFLUX_ERRcolumns 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 :
ndarrayFractional excess variance.
References
[Vaughan20032627] “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 :
Axesor None, optional.Returns: ax :
Axesor None, optional.
-
classmethod
read(filename, **kwargs)[source]¶ Read from file.
Parameters: filename : str
Filename
kwargs : dict
Keyword arguments passed to
astropy.table.Table.read.
-
write(filename, **kwargs)[source]¶ Write to file.
Parameters: filename : str
Filename
kwargs : dict
Keyword arguments passed to
astropy.table.Table.write.
-