def _get_slice(n_dims, ref_dim, ref_id):
    """source: https://stackoverflow.com/a/24399139/4222370"""
    slc = [slice(None)] * n_dims
    slc[ref_dim] = ref_id
    return tuple(slc)
source: https://stackoverflow.com/a/24399139/4222370
pysteps/blending/linear_blending.py