ellipse¶
-
utilipy.data_utils.
ellipse
(*x: Union[numpy.array, Sequence], x0: Union[float, Sequence] = 0.0, dx: Union[float, Sequence] = 1.0, as_ind: bool = False) → numpy.array[source]¶ Elliptical selection of data in many dimensions.
Supports selection with variable center and radius:
np.sum((x[i] - x0[i]) / dx[i])^2) < 1^2
- Parameters
- x: m x (n, 1) array_like
values along each dimension
- x0: scalar or (m, 1) array, optional
(default = 0.) the center position of each x. can broadcast a scalar to apply to all
- dx: scalar or (m, 1) array, optional
(default = 0.) the radius in each dimension
- Returns
- sel: array_like of bool
bool array selecting data w/in ellipse if as_ind is True, then array_like of indices
- Other Parameters
- as_indbool or “flatten”, optional
(default False) whether to return a boolean array, or array of indices.
- Raises
ValueError
if
as_ind
is “flatten” and cannot be flattened (len > 1)