correlation#

esis.optics.correlation(a, b, axis=None)[source]#

Compute the Pearson correlation coefficient of two arrays.

Maximizing the correlation is the same as minimizing the squared difference after fitting a gain and an offset, so it is the least-squares merit with the absolute calibration of the frame left free.

Parameters:
  • a (AbstractScalar) – The first array, standardized before comparing. If it is constant, the correlation is zero.

  • b (AbstractScalar) – The second array, standardized before comparing. If it is constant, the correlation is zero.

  • axis (None | tuple[str, ...]) – The logical axes along which to compute the correlation. If None, the correlation is computed over every axis.

Return type:

AbstractScalar