npix_rect_ann_exact
npix_rect_ann_exact(
x,
y,
w_in,
h_in,
w_out,
h_out,
theta_in=0.0,
theta_out=None,
*,
shape,
mask=None,
validate=True,
)Return exact rotated-rectangle-annulus 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. w_in, h_in : float-
Inner rectangle full width and height in pixels.
w_inis measured along the inner rectangle’s local x axis, andh_inalong its local y axis. w_out, h_out : float-
Outer rectangle full width and height in pixels.
w_outis measured along the outer rectangle’s local x axis, andh_outalong its local y axis. Each outer dimension must be no smaller than the corresponding inner dimension, and at least one outer dimension must be larger. Attheta_out=0, the outer width axis is aligned with the image x axis and the outer height axis with the image y axis. theta_in : float, optional = 0.0-
Inner rectangle rotation angle in radians, measured counterclockwise from the positive image x axis to the inner rectangle’s local width axis.
theta_out : float or None, optional = None-
Outer rectangle rotation angle in radians, measured counterclockwise from the positive image x axis to the outer rectangle’s local width axis. If
None, usestheta_in. 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.Truepixels are excluded from the returned effective pixel count.
Returns
npix : ndarray-
Effective pixel count inside the image frame.
Notes
For matched inner and outer angles, this uses outer-minus-inner direct aperture summation. For split-angle annuli, it uses Rust-generated bbox-tight annulus weights and the same BoundingBox.apsum reduction.