compute_lightcurve_discrete_correlation#

gammapy.estimators.utils.compute_lightcurve_discrete_correlation(lightcurve1, lightcurve2=None, flux_quantity='flux', tau=None)[source]#

Compute the discrete correlation function for two lightcurves, or the discrete autocorrelation if only one lightcurve is provided.

NaN values will be ignored in the computation in order to account for possible gaps in the data.

Internally calls the discrete_correlation function.

Parameters:
lightcurve1FluxPoints

The first lightcurve object.

lightcurve2FluxPoints, optional

The second lightcurve object. If not provided, the autocorrelation for the first lightcurve will be computed. Default is None.

flux_quantitystr

Flux quantity to use for calculation. Should be ‘dnde’, ‘flux’, ‘e2dnde’ or ‘eflux’. The choice does not affect the computation. Default is ‘flux’.

tauQuantity, optional

Size of the bins to compute the discrete correlation. If None, the bin size will be double the bins of the first lightcurve. Default is None.

Returns:
discrete_correlation_dictdict

Dictionary containing the discrete correlation results. Entries are:

  • “bins” : the array of discrete time bins

  • “discrete_correlation” : discrete correlation function values

  • “discrete_correlation_err” : associated error

References

[Edelson1988]

“THE DISCRETE CORRELATION FUNCTION: A NEW METHOD FOR ANALYZING UNEVENLY SAMPLED VARIABILITY DATA”, Edelson et al. (1988) https://ui.adsabs.harvard.edu/abs/1988ApJ…333..646E/abstract