slicer

sofia_redux.toolkit.utilities.func.slicer(array, axis, index, ind=False)[source]

Returns a slice of an array in arbitrary dimension.

Parameters:
arraynumpy.ndarray

array to slice

axisint or array_like

axis to slice on

indexint or array_like of int

index retrieved

indbool, optional

If True, return the slices rather than sliced array

Returns:
numpy.ndarray or tuple of slice