Correlation
- class mutis.correlation.Correlation(signal1, signal2, fcorr)[source]
Bases:
objectAnalysis of the correlation of two signals.
- Parameters
Methods Summary
gen_corr([uncert, dsamples])Generates the correlation of the signals.
gen_synth(samples)Generates the synthetic light curves.
gen_times([ftimes])Sets times and bins using the method defined by ftimes parameter.
peak_find([smooth, smooth_std, Ninterp])Find the peaks of the correlation, optionally smoothing with a kernel of standard deviation s.
plot_corr([uncert, ax, legend])Plots the correlation of the signals.
plot_signals([ax])Plots the signals involved in this correlation.
plot_times([rug])Plots the time binning generated previously.
Methods Documentation
- gen_corr(uncert=True, dsamples=500)[source]
Generates the correlation of the signals.
Generates the correlation of the signals, and computes their confidence level from the synthetic light curves, which must have been generated before.
- gen_synth(samples)[source]
Generates the synthetic light curves.
Generates the specified number samples of synthetic light curves for each signal, to be used to compute the significance the correlation.
- Parameters
- samples
int Number of synthetic light curves to be generated for each signal.
- samples
- gen_times(ftimes='canopy', *args, **kwargs)[source]
Sets times and bins using the method defined by ftimes parameter.
- Parameters
- ftimes
str Method used to bin the time interval of the correlation. Possible values are: - “canopy”: Computes a binning as dense as possible, with variable bin width and (with a minimum and a maximum resolution) and a minimum statistic. - “rawab”: Computes a binning with variable bin width, a given step, maximum bin size and a minimum statistic. - “uniform”: Computes a binning with uniform bin width and a minimum statistic. - “numpy”: Computes a binning suitable for method=’numpy’.
- ftimes
- peak_find(smooth=False, smooth_std=None, Ninterp=1000)[source]
Find the peaks of the correlation, optionally smoothing with a kernel of standard deviation s. Returns dict with peak positions and significances, ordered from closest to farthest from zero.
- plot_corr(uncert=True, ax=None, legend=False)[source]
Plots the correlation of the signals.
Plots the correlation of the signal, and the confidence limits computed from the synthetic curves.
- Parameters
- ax
matplotlib.axes.Axes Axes to be used (default None, it creates a new axes).
- legend
bool Whether to add a legend indicating the confidence levels.
- ax
- plot_signals(ax=None)[source]
Plots the signals involved in this correlation.
Plots the signals involved in this correlation, in the same window but with different twin y-axes and different colors.
- Parameters
- ax
Axes Axes to be used for plotting.
- ax
- plot_times(rug=False)[source]
Plots the time binning generated previously.
Plots the number of total bins, their distribution and the number of points in each bin for the generated time binning, previously generated with Correlation().gen_times(…).
- Parameters
- rug
bool Whether to make a rug plot just below the binning, to make it easier to visually understand the density and distribution of the generated bins.
- rug