sunkit_image.time_lag.max_cross_correlation(signal_a, signal_b, time: Unit('s'), lag_bounds: astropy.units.Quantity | None = None)[source]#

Compute the maximum value of the cross-correlation between signal_a and signal_b.

This is the maximum value of the cross-correlation as a function of lag (computed in cross_correlation()). This will always be between -1 (perfectly anti-correlated) and +1 (perfectly correlated) though in practice is nearly always between 0 and +1.

  • signal_a (array-like) – The first dimension must be the same length as time.

  • signal_b (array-like) – Must have the same dimensions as signal_a.

  • time (array-like) – Time array corresponding to the intensity time series signal_a and signal_b.

  • lag_bounds (tuple, optional) – Minimum and maximum lag to consider when finding the time lag that maximizes the cross-correlation. This is useful for minimizing boundary effects.


array-like – Maximum value of the cross-correlation. The dimensions will be consistent with those of signal_a and signal_b, i.e. if the input arrays are of dimension (K,M,N), the resulting array will have dimensions (M,N). Similarly, if the input signals are one-dimensional time series (K,), the result will have dimension (1,).