PillAn

PillAn(
    positions,
    w_in,
    a_in,
    b_in,
    w_out,
    a_out,
    b_out,
    *,
    theta_in=0.0,
    theta_out=None,
    plot_samples=96,
    validate=True,
)

Capsule-like annulus with explicit inner and outer pills.

The outer boundary is a pill with rectangle length w_out and cap semiaxes a_out and b_out. The inner boundary uses explicit w_in, a_in, and b_in values. Its masks use fused Rust kernels that subtract the inner composite pill from the outer composite pill. If theta_out is None, it defaults to theta_in.

Parameters

positions : tuple or array - like

Annulus center or centers as (x, y) pixel coordinates. Multiple centers are accepted as an (N, 2) array-like object.

w_in : float

Inner central-rectangle length in pixels.

a_in : float

Inner cap semimajor axis in pixels.

b_in : float

Inner cap semiminor axis in pixels.

w_out : float

Outer central-rectangle length in pixels. Must be larger than w_in.

a_out : float

Outer cap semimajor axis in pixels. Must be larger than a_in.

b_out : float

Outer cap semiminor axis in pixels. Must be larger than b_in.

theta_in : float = 0.0

Inner pill rotation angle in radians, measured counterclockwise from the positive x axis.

theta_out : float = None

Outer pill rotation angle in radians, measured counterclockwise from the positive x axis. If None, it defaults to theta_in.

plot_samples : int = 96

Even number of samples used to draw each pill boundary when creating Matplotlib patches.

validate : bool = True

If False, skip input validation and assume finite, positive geometry, ordered inner/outer dimensions, and normalized positions.

Attributes

area : float

Analytic geometric annulus area. Image clipping and bad-pixel masks are accounted for by npix results, not by this property.