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
slsuch that every element ofx_array[sl]lies in[x_min, x_max]. Returnsslice(0, 0)when no element satisfiesx >= x_min.
- Raises:
- AssertionError
If
x_max < x_min.