def mean(X, shape):
    """
    Compute the mean value of a two-dimensional array in the spectral domain.

    Parameters
    ----------
    X: 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 array
        in the spatial domain.

    Returns
    -------
    out: float
        The mean value.
    """
    return np.real(X[0, 0]) / (shape[0] * shape[1])
Compute the mean value of a two-dimensional array in the spectral domain.

Parameters
----------
X: 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 array
in the spatial domain.

Returns
-------
out: float
The mean value.
pysteps/utils/spectral.py