view_shape

glue.utils.array.view_shape(shape, view)[source]

Return the shape of a view of an array.

Returns equivalent of np.zeros(shape)[view].shape

Parameters:

shape : tuple

The shape of the array

view : slice

A valid index into a Numpy array, or None