def computeWiener(kx, ky, L0, r0):
    """
    <kx>  : spatial frequency produced by
            the function computeSpatialFreqArrays() (metres^-1)
    <ky>  : idem kx
    <L0>  : value of the outer scale (metres)
    <r0>  : value of Fried parameter r0 (metres)

    The function returns the 2D spectrum of the turbulence with an outer
    scale L0. It is expressed in rad^2.m^2.

    Result is returned with a frequency corner-centred representation.

    Standalone example::

        N = 512               # output will be 512x512
        pixelSize = 4.2       # 4.2 mas
        wavelength = 1.65e-6  # metres.  H band.
        L0 = 25.              # 25 metres outer scale
        r0 = 0.6              # r0 = 60cm in H band
        kx, ky, uk = computeSpatialFreqArrays(N, pixelSize, wavelength)
        W = computeWiener(kx, ky, L0, r0)

    """
    Wiener = (kx ** 2 + ky ** 2 + 1.0 / L0 ** 2.0) ** (-11.0 / 6)
    Wiener *= 0.0228956 * r0 ** (-5.0 / 3)
    Wiener[0, 0] = 0.0
    return Wiener
