Skip to content

radrs.qc

Quality control tools for radar data.

The module exposes two layers:

  • Low-level array ops (fast, implemented in Rust): rhohv_threshold, sun_spike, vradh_winding_number.
  • High-level QC steps for raystack parsing: RhohvThreshold, SunSpike, VradhWindingNumber.

Mask values are:

  • 1 — valid data
  • 0 — invalid data (e.g., below threshold or sun spike)
  • -1 — missing data (NaN in input)

Examples:

Apply an RHOHV threshold during raystack parsing:

import radrs.raystack as rrs
import radrs.qc as qc

rs = rrs.parse(file_bytes, qc=[qc.RhohvThreshold(threshold=0.8)])
rs["returns"]["qc.rhohv_threshold_mask"].shape

QCStep

Base class for built-in QC steps.

RhohvThreshold dataclass

Bases: QCStep

RHOHV threshold mask.

SunSpike dataclass

Bases: QCStep

Sun spike mask from DBZH.

VradhWindingNumber dataclass

Bases: QCStep

VRADH winding number from region-based dealiasing.

compile_qc_steps

compile_qc_steps(
    qc: Optional[Iterable[QCStep] | QCStep],
) -> Optional[List[dict]]

Compile QC steps into a compact spec for the Rust parser.