coordinates.mixins.core.CoordinateSystemAxesMixin.get_mask_from_axes#

CoordinateSystemAxesMixin.get_mask_from_axes(axes: str | Sequence[str]) ndarray[source]#

Return a boolean mask of shape (ndim,) with True on the positions corresponding to axes.

Parameters:

axes (str or Sequence[str]) – An axis name or iterable of axis names.

Returns:

Boolean mask selecting those axes.

Return type:

numpy.ndarray

Examples

>>> cs.get_mask_from_axes("phi")
array([False, False,  True])
>>> cs.get_mask_from_axes(["r", "theta"])
array([ True,  True, False])