triqs.plot.protocol.clip_array

triqs.plot.protocol.clip_array(x_array, x_min, x_max)[source]

Return the slice selecting entries of an ordered array within a window.

Parameters:
x_arrayarray_like

1D sequence of monotonically non-decreasing values. Any iterable that yields values in order is accepted.

x_minfloat

Lower bound of the window (inclusive).

x_maxfloat

Upper bound of the window (inclusive).

Returns:
slice

Slice sl such that every element of x_array[sl] lies in [x_min, x_max]. Returns slice(0, 0) when no element satisfies x >= x_min.

Raises:
AssertionError

If x_max < x_min.