PillAp
PillAp(positions, w, a, b, theta=0.0, plot_samples=96, *, validate=True)Capsule-like aperture composed from one rectangle and two ellipses.
The pill aperture has a central rectangle of length w and height 2 * b with elliptical caps of semiaxes a and b centered on the rectangle ends. Its masks use fused Rust kernels that preserve the package’s composite rectangle-plus-cap semantics.
Parameters
positions : tuple or array - like-
Aperture center or centers as
(x, y)pixel coordinates. Multiple centers are accepted as an(N, 2)array-like object. w : float-
Length of the central rectangle in pixels, measured along the pill major axis between the two cap centers.
a : float-
Semimajor axis of each elliptical cap in pixels.
b : float-
Semiminor axis of each elliptical cap in pixels. The central rectangle height is
2 * b. theta : float = 0.0-
Rotation angle in radians, measured counterclockwise from the positive x axis.
plot_samples : int = 96-
Even number of samples used to draw the two elliptical caps when creating Matplotlib patches.
validate : bool = True-
If
False, skip input validation and assume finite, positive geometry and normalized positions.
Attributes
area : float-
Analytic geometric area,
w * 2 * b + pi * a * b. Image clipping and bad-pixel masks are accounted for bynpixresults, not by this property.