def _compute_freq_array(array, ds_factor=1):
    """
    Compute the frequency array following a given downscaling factor.
    """
    freq_i = np.fft.fftfreq(array.shape[0] * ds_factor, d=1 / ds_factor)
    freq_j = np.fft.fftfreq(array.shape[1] * ds_factor, d=1 / ds_factor)
    freq_sqr = freq_i[:, None] ** 2 + freq_j[None, :] ** 2
    return np.sqrt(freq_sqr)
Compute the frequency array following a given downscaling factor.
pysteps/downscaling/rainfarm.py