pysteps.utils.spectral.corrcoef

pysteps.utils.spectral.corrcoef

pysteps.utils.spectral.corrcoef(X, Y, shape, use_full_fft=False)

Compute the correlation coefficient between two-dimensional arrays in the spectral domain.

Parameters
X: array_like

A complex array representing the Fourier transform of a two-dimensional array.

Y: array_like

A complex array representing the Fourier transform of a two-dimensional array.

shape: tuple

A two-element tuple specifying the shape of the original input arrays in the spatial domain.

use_full_fft: bool

If True, X and Y represent the full FFTs of the original arrays. Otherwise, they are assumed to contain only the symmetric part, i.e. in the format returned by numpy.fft.rfft2.

Returns
out: float

The correlation coefficient. Gives the same result as numpy.corrcoef(X.flatten(), Y.flatten())[0, 1].