npix_wedge_exact

npix_wedge_exact(
    x,
    y,
    r_in,
    r_out,
    theta_in,
    dtheta_in,
    theta_out=None,
    dtheta_out=None,
    *,
    shape,
    mask=None,
    validate=True,
)

Return exact wedge-aperture effective in-frame pixel counts.

Parameters

x, y : scalar or array_like

Aperture center coordinates in pixel units. Shapes must match after numpy.atleast_1d. The return shape matches that broadcast-free input shape, so scalar inputs return one-element arrays.

r_in, r_out : float

Inner and outer wedge radii in pixels. r_out must be larger than r_in and r_in must be positive.

theta_in, dtheta_in : float

Center angle and full angular width at r_in, in radians.

theta_out, dtheta_out : float or None, optional

Center angle and full angular width at r_out. If either value is None, the corresponding inner value is used.

shape : tuple[int, int]

Image shape as (ny, nx) used to clip the aperture footprint.

mask : array_like of bool, optional = None

Boolean image mask with shape shape. True pixels are excluded from the returned effective pixel count.

Returns

npix : ndarray

Effective pixel count inside the image frame.

Notes

exact mode computes analytic fractional pixel overlap for annular wedges. Constant-width wedges use a circular-sector path; generalized wedges connect inner and outer arc endpoints with straight sides.