def centered(curr_size, new_size):
    """
    Use with convolution, return center indices for an array of a specific len.

    Parameters
    ----------
    curr_size: int
        Length of dimension to truncate in the current array.
    new_size: int
        Intended length of the dimension to truncate in the new array.

    Returns
    -------
    ind: np.ndarray, shape: (new_size,)
        Indices to excise the center portion along one dimension
        of the current array.
    """

    curr_size = int(curr_size)
    new_size = int(new_size)

    center = curr_size - (curr_size + 1) // 2
    return slice(center - (new_size) // 2, center + (new_size + 1) // 2)