RectAn

RectAn(
    positions,
    w_in,
    h_in,
    w_out,
    h_out,
    *,
    theta_in=0.0,
    theta_out=None,
    validate=True,
)

Rotated rectangular annulus in pixel coordinates.

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. 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_in : float

Inner rectangle full width and height in pixels. w_in is measured along the inner rectangle’s local x axis, and h_in along its local y axis.

h_in : float

Inner rectangle full width and height in pixels. w_in is measured along the inner rectangle’s local x axis, and h_in along its local y axis.

w_out : float

Outer rectangle full width and height in pixels. w_out is measured along the outer rectangle’s local x axis, and h_out along its local y axis. Each outer dimension must be at least the corresponding inner dimension, and at least one outer dimension must be larger. At theta_out=0, the outer width axis is aligned with the image x axis and the outer height axis with the image y axis.

h_out : float

Outer rectangle full width and height in pixels. w_out is measured along the outer rectangle’s local x axis, and h_out along its local y axis. Each outer dimension must be at least the corresponding inner dimension, and at least one outer dimension must be larger. At theta_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 = 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 = 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, it defaults to theta_in.

validate : bool = True

If False, skip input validation and assume finite, positive geometry, ordered dimensions, and finite positions with shape (2,) or (N, 2). Coordinates are still copied and converted to float64.

Methods

Name Description
bboxes Override the default python for-loop with a Rust-accelerated batch function.

bboxes

RectAn.bboxes()

Override the default python for-loop with a Rust-accelerated batch function.