Skip to content

radrs.ops

radrs.ops - Low-level array ops

This module provides fast alignment and texture utilities implemented in Rust.

Notes
  • Arrays are expected to be float32 and C-contiguous for zero-copy performance.
  • Alignment plans map destination indices to source indices and can be reused across multiple fields.

align_azimuth

align_azimuth(
    src_azimuth,
    dst_azimuth,
    tolerance_deg: Optional[float] = None,
    wrap: bool = True,
) -> AzimuthPlan

Create an azimuth alignment plan.

Parameters:

Name Type Description Default
src_azimuth array - like

Source azimuths (degrees).

required
dst_azimuth array - like

Destination azimuths (degrees).

required
tolerance_deg float

Maximum angular difference allowed for a match.

None
wrap bool

If True, treat azimuths modulo 360.

True

align_range

align_range(
    src_start_m: float,
    src_step_m: float,
    src_len: int,
    dst_start_m: float,
    dst_step_m: float,
    dst_len: int,
    tolerance_m: Optional[float] = None,
) -> RangePlan

Create a range alignment plan.

Parameters:

Name Type Description Default
src_start_m float

Source gate start (meters).

required
src_step_m float

Source gate spacing (meters).

required
src_len int

Number of source gates.

required
dst_start_m float

Destination gate start (meters).

required
dst_step_m float

Destination gate spacing (meters).

required
dst_len int

Number of destination gates.

required
tolerance_m float

Maximum range difference allowed for a match.

None

velocity_texture

velocity_texture(
    vradh,
    nyquist: Optional[float] = None,
    wind_size: Optional[int] = None,
)

Compute velocity texture for a single sweep (2D array).