def _make_gaussian_kernel(ds_factor):
    """
    Compute 2d gaussian kernel
    ref: https://github.com/scipy/scipy/blob/de80faf9d3480b9dbb9b888568b64499e0e70c19/scipy/ndimage/_filters.py#L179
    the smoothing sigma has width half a large pixel
    """
    radius = _compute_kernel_radius(ds_factor)
    sigma = ds_factor / 2
    sigma2 = sigma * sigma
    x = np.arange(-radius, radius + 1)
    kern1d = np.exp(-0.5 / sigma2 * x**2)
    kern2d = np.outer(kern1d, kern1d)
    return kern2d / kern2d.sum()
Compute 2d gaussian kernel
ref: https://github.com/scipy/scipy/blob/de80faf9d3480b9dbb9b888568b64499e0e70c19/scipy/ndimage/_filters.py#L179
the smoothing sigma has width half a large pixel
pysteps/downscaling/rainfarm.py