sep.mask_ellipse#
- sep.mask_ellipse(arr, x, y, a, b, theta, r=1.0)#
Mask ellipse(s) in an array.
Set array elements to True (or 1) if they fall within the given ellipse. The
rkeyword can be used to scale the ellipse. Equivalently, after convertinga,b,thetato a coefficient ellipse representation (cxx,cyy,cxy), pixels that fulfill the condition\[cxx(x_i - x)^2 + cyy(y_i - y)^2 + cxx(x_i - x)(y_i - y) < r^2\]will be masked.
- Parameters:
- arr
ndarray Input array to be masked. Array is updated in-place.
- x, yarray_like
Center of ellipse(s).
- a, b, thetaarray_like, optional
Parameters defining the extent of the ellipe(s).
- cxx, cyy, cxyarray_like, optional
Alternative ellipse representation. Can be used as
mask_ellipse(arr, x, y, cxx=..., cyy=..., cxy=...).- rarray_like, optional
Scale factor of ellipse(s). Default is 1.
- arr