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. Coordinates are copied into owned, read-only float64 storage. Editing the input does not move the aperture; construct a new aperture to change centers. The positions attribute cannot be reassigned. C-order, Fortran-order, and strided inputs are accepted. Input (x, y) gives scalar sums; [(x, y)] gives length-one vector sums.

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 finite positions with shape (2,) or (N, 2). Coordinates are still copied and converted to float64.

Attributes

area : float

Analytic geometric area, w * 2 * b + pi * a * b. Image clipping and bad-pixel masks are accounted for by npix results, not by this property.