coordinates.mixins.core.CoordinateSystemAxesMixin.get_indices_from_mask#

CoordinateSystemAxesMixin.get_indices_from_mask(mask: ndarray) int | List[int][source]#

Convert a boolean mask of length ndim back to numeric indices.

Parameters:

mask (numpy.ndarray) – Boolean selector for axes.

Returns:

  • An int if exactly one element is True.

  • A list of ints if multiple elements are True.

Return type:

int or list[int]

Raises:

ValueError – If the mask length does not equal ndim.