def _compute_noise_field(freq_array_highres, alpha):
    """
    Compute a field of correlated noise field using the given frequency array and alpha
    value.
    """
    white_noise_field = np.random.rand(*freq_array_highres.shape)
    white_noise_field_complex = np.exp(complex(0, 1) * 2 * np.pi * white_noise_field)
    with warnings.catch_warnings():
        warnings.simplefilter("ignore")
        noise_field_complex = white_noise_field_complex * np.sqrt(
            freq_array_highres**-alpha
        )
    noise_field_complex[0, 0] = 0
    return np.fft.ifft2(noise_field_complex).real
Compute a field of correlated noise field using the given frequency array and alpha
value.
pysteps/downscaling/rainfarm.py