def np_get_index(ndim,axis,slice_number):
    """
    Construct an index for used in slicing numpy array by specifying the
        axis and the slice in the axis.

    Parameters:
    -----------
    1. axis: the axis of the array.
    2. slice_number: the 0-based slice number in the axis.
    3. ndim: the ndim of the ndarray.
    """
    full_idx = [slice(None)] * ndim
    full_idx[axis] = slice_number
    return full_idx