ess.reduce.live.roi.select_indices_in_polygon#

ess.reduce.live.roi.select_indices_in_polygon(polygon, indices)[source]#

Return subset of indices that fall within the polygon.

Parameters:
  • polygon (dict[str, Variable | Sequence[float]]) –

    Polygon vertices as a dict mapping axis names to 1-D arrays of vertex positions. Must contain exactly two entries. Each entry can be either:

    • A scipp Variable for coordinate-based selection (uses named coordinates from the indices DataArray, with unit validation)

    • A sequence of floats for index-based selection (uses dimension indices as coordinates, no unit handling)

    The two axes can independently use either mode.

  • indices (DataArray) – DataArray with indices to select from. For coordinate-based axes, must have coordinates matching the axis names. For index-based axes, must have dimensions matching the axis names.

Returns:

Variable – Variable with selected indices.