Airborne Weather Radar (avionics/surveillance/airborne-weather-radar)
Use when the task is computing airborne weather radar operating-point
quantities for convective weather avoidance: mapping radar reflectivity
factor Z to rainfall rate through the Marshall-Palmer Z-R relation and
back, pointing the antenna tilt at a storm cell top, converting slant
range to displayed ground range, checking a tilt setting for ground
clutter return, and rating echo intensity into standard display levels.
This leaf implements the operating-point model in pure Python, stdlib
only, deterministic. It pairs with the surveillance siblings for the
wider air picture: air-to-air surveillance performance and collision
avoidance logic live in the sibling leaves, not here.
Domain quick reference
- Marshall-Palmer Z-R relation: Z = a * R^b with Z in mm6/m3 and R in
mm/h; module constants a = A_DEFAULT = 200.0 and b = B_DEFAULT = 1.6.
The inverse is R = (Z / a)^(1 / b), so the pair round-trips any rate
within 1e-6 relative.
- dBZ scale: dBZ = 10 * log10(Z). The Z-R relation is commonly quoted in
dBZ form (20 mm/h gives about 43.8 dBZ).
- Cell top scan tilt: tilt = atan((cell_top_alt - own_alt) / slant_range)
in degrees. The altitude difference may be negative when the cell top
sits below the aircraft, and the tilt is then negative (beam points
down).
- Displayed ground range (flat-earth): ground =
sqrt(slant_range^2 - (own_alt - target_alt)^2). The earth-curvature
constant RE_ARTH = 6371000.0 m is informational only; the model is
flat-earth, which is valid for the short display ranges here.
- Ground clutter geometry: the lowest edge of the beam at the slant range
sits at tilt - beam_width / 2. The angle to the terrain at that range
is atan((terrain - own_alt) / slant_range). Clutter risk exists when
the lowest beam edge lies below the terrain angle, because the beam
still illuminates the ground.
- Echo levels: level 1 below 30 dBZ, level 2 from 30 to 40 dBZ, level 3
from 40 to 50 dBZ, level 4 at 50 dBZ and above. Because log is
monotonic, the linear Z thresholds 1000 / 10000 / 100000 mm6/m3 mark
the same band edges.
- RTCA DO-185 frames the airborne weather radar MOPS context. The
relations above are standard engineering methodology, summary-only.
Workflow
- Convert rainfall to reflectivity with reflectivity_from_rainfall
(Z = a * R^b) when the input is a rain rate, or invert with
rainfall_from_reflectivity when the radar reports Z.
- Confirm the conversion round-trips: the inverse of the forward value
returns the starting rate within 1e-6 relative.
- Point the beam: tilt_to_cell_top(own_altitude_m, cell_top_altitude_m,
slant_range_m) returns the elevation tilt that puts the beam axis on
the cell top. Negative tilt means the cell lies below the aircraft.
- Get the displayed range: ground_range_from_slant(slant_range_m,
own_altitude_m, target_altitude_m) with the default 0 m target for the
surface reference.
- Check the tilt against terrain: clutter_check(tilt_deg,
own_altitude_m, slant_range_m, terrain_elevation_m, beam_width_deg)
returns the beam lowest edge and the clutter verdict.
- Rate the echo: echo_level(reflectivity) returns the standard four
level category for the cockpit weather display.
- For the full operating point in one call, run
weather_radar_assessment(rainfall_mm_h, own_altitude_m,
cell_top_altitude_m, slant_range_m, terrain_elevation_m,
beam_width_deg) and read the six documented keys.
- Confirm the deterministic checks with the contract test
scripts/test_airborne_weather_radar.py.
Worked example
Rainfall 20 mm/h, own altitude 3048 m (10 000 ft), cell top 12 192 m
(40 000 ft), slant range 111 120 m (60 NM), terrain 0 m, beam width 3 deg.
- Reflectivity: Z = 200 * 20^1.6 = 24 136.71 mm6/m3 (43.83 dBZ), inside
the 20 000 to 28 000 bound. At 50 mm/h the value is 104 563.96 mm6/m3,
inside the 90 000 to 120 000 bound.
- Rainfall round trip: rainfall_from_reflectivity(24 136.71) returns
20.00 mm/h, within 1% (1e-6 relative) of the input.
- Tilt to cell top: atan(9144 / 111 120) = 4.704 deg, inside the 3.5 to
6.0 deg bound (the cell top 9144 m above the aircraft).
- Ground range: sqrt(111 120^2 - 3048^2) = 111 078.19 m, within 0.5% of
the slant range (displayed range is nearly the slant range at high
altitude).
- Clutter check: beam lowest edge 4.704 - 1.5 = 3.204 deg above the
horizon. The terrain angle at 111 120 m is atan(-3048 / 111 120) =
-1.57 deg, so the beam is clear of the ground and clutter_verdict is
False.
- Echo level: 24 136.71 mm6/m3 sits in the 40 to 50 dBZ band, so
echo_level returns 3.
Verification
- Reflectivity at 20 mm/h stays in 20 000 to 28 000 mm6/m3 and at
50 mm/h in 90 000 to 120 000 mm6/m3; tilt stays in 3.5 to 6.0 deg;
ground range stays within 0.5% of the slant range.
- Round trip: the Z-R inverse of the forward value returns the input
rate within 1e-6 relative for any rate.
- Monotonicity: reflectivity rises with rainfall and tilt rises as the
cell top rises.
- Clutter verdict flips True when the terrain angle exceeds the beam
lowest edge (terrain 1000 m at 5000 m range from own 500 m with 0 deg
tilt returns True).
- Every non-physical input raises ValueError: negative rainfall or
reflectivity, a <= 0, b <= 0, slant range <= 0, beam width <= 0, and a
slant range shorter than the altitude difference in
ground_range_from_slant.
- Determinism: no RNG anywhere, run-to-run identical floats.
- Run the contract test offline: python3
scripts/test_airborne_weather_radar.py (32 tests, deterministic).
Related leaves
- avionics/surveillance/ads-b-surveillance: the broadcast surveillance
sibling for air-to-air position and velocity performance, which owns
the automatic dependent surveillance broadcast link.
- avionics/surveillance/tcas-resolution-advisory: the collision avoidance
sibling, which owns resolution advisory decision making and its own
surveillance logic.
Pitfalls
- Replacing the module's Z-R constants: the reflectivity conversion
uses Z = 200.0 * R^1.6 (A_DEFAULT, B_DEFAULT) - swapping in another
Marshall-Palmer pair (say 300/1.4 for convective rain) without
touching the module constants changes every reflectivity, echo
level, and round trip this leaf reports.
- Comparing across the dBZ and linear scales: the echo bands are
30 / 40 / 50 dBZ, which log-monotonically match the linear Z
thresholds 1000 / 10000 / 100000 mm6/m3 - a rate compared as linear
Z against a dBZ band edge mis-ranks the echo level.
- Forgetting the tilt can go negative: tilt is atan((cell_top - own) /
slant_range), so a cell top below the aircraft gives a downward
pointing beam - the altitude difference is signed and a negative
tilt is a valid operating point, not an input error.
- Applying earth curvature to the displayed range: the model is
flat-earth, ground = sqrt(slant^2 - (own - target)^2), and
RE_ARTH = 6371000.0 m is informational only - at high altitude the
displayed range is nearly the slant range (111 078.19 m from a
111 120 m slant), and a slant range shorter than the altitude
difference raises ValueError instead of returning an imaginary
square root.
- Reversing the clutter comparison: clutter exists when the beam's
lowest edge (tilt - beam_width / 2) lies below the terrain angle,
because the beam still illuminates the ground - the worked example
is clear (3.204 deg edge above a -1.57 deg terrain angle), and the
verdict flips True only when the terrain angle rises above the
edge, as in the 1000 m terrain case at 5000 m.
- Slipping the echo band edges: level 2 spans 30 to 40 dBZ, level 3
spans 40 to 50 dBZ, and level 4 starts at 50 dBZ - the 24 136.71
mm6/m3 worked echo (43.83 dBZ) is level 3, and boundary reflectivity
must be graded on the linear threshold 1000 / 10000 / 100000, not a
rounded dBZ guess.
Behavior contract (gate 3)
Run the deterministic contract test (stdlib unittest, offline):
python3 scripts/test_airborne_weather_radar.py
The test covers the worked-example contract (reflectivity values and
magnitude bounds, tilt and ground range real outputs, clutter lowest edge
and verdict, echo level 3), the Z-R round trip within 1e-6 relative, both
monotonicity directions, echo level band edges at 30 / 40 / 50 dBZ,
clutter verdict truth and toggling geometry, exact convenience-chain keys,
determinism, float output types, module constants, and ValueError
rejection of every non-physical input in the spec validation list.
Compliance
- RTCA DO-185 (airborne weather radar MOPS) is referenced, reference-only
and gated in standards-map.yaml: no test text or proprietary tables are
reproduced. The Marshall-Palmer Z-R relation and the geometry above are
standard engineering methodology, summary-only.
- compliance: STANDARDS-REF, gated: false.
1---2name: airborne-weather-radar3description: Use when you must compute airborne weather radar operating-point quantities for convective weather avoidance: convert radar reflectivity factor Z to rainfall rate and back with the Marshall-Palmer Z-R relation, estimate the antenna elevation tilt that scans a storm cell top from own altitude and slant range, derive the flat-earth ground range to the cell, check a tilt setting against ground clutter return geometry, and rate echo intensity into standard levels from the reflectivity. Produces the rainfall rate, the required tilt angle, the ground range, the clutter check verdict and the echo level that gate weather radar tilt management in the cockpit. Trigger: airborne weather radar, convective weather avoidance, storm cell top, antenna tilt, reflectivity factor, rainfall rate, marshall palmer, echo level, ground clutter.4license: Apache-2.05---67# Airborne Weather Radar (avionics/surveillance/airborne-weather-radar)89Use when the task is computing airborne weather radar operating-point10quantities for convective weather avoidance: mapping radar reflectivity11factor Z to rainfall rate through the Marshall-Palmer Z-R relation and12back, pointing the antenna tilt at a storm cell top, converting slant13range to displayed ground range, checking a tilt setting for ground14clutter return, and rating echo intensity into standard display levels.15This leaf implements the operating-point model in pure Python, stdlib16only, deterministic. It pairs with the surveillance siblings for the17wider air picture: air-to-air surveillance performance and collision18avoidance logic live in the sibling leaves, not here.1920## Domain quick reference2122- Marshall-Palmer Z-R relation: Z = a * R^b with Z in mm6/m3 and R in23 mm/h; module constants a = A_DEFAULT = 200.0 and b = B_DEFAULT = 1.6.24 The inverse is R = (Z / a)^(1 / b), so the pair round-trips any rate25 within 1e-6 relative.26- dBZ scale: dBZ = 10 * log10(Z). The Z-R relation is commonly quoted in27 dBZ form (20 mm/h gives about 43.8 dBZ).28- Cell top scan tilt: tilt = atan((cell_top_alt - own_alt) / slant_range)29 in degrees. The altitude difference may be negative when the cell top30 sits below the aircraft, and the tilt is then negative (beam points31 down).32- Displayed ground range (flat-earth): ground =33 sqrt(slant_range^2 - (own_alt - target_alt)^2). The earth-curvature34 constant RE_ARTH = 6371000.0 m is informational only; the model is35 flat-earth, which is valid for the short display ranges here.36- Ground clutter geometry: the lowest edge of the beam at the slant range37 sits at tilt - beam_width / 2. The angle to the terrain at that range38 is atan((terrain - own_alt) / slant_range). Clutter risk exists when39 the lowest beam edge lies below the terrain angle, because the beam40 still illuminates the ground.41- Echo levels: level 1 below 30 dBZ, level 2 from 30 to 40 dBZ, level 342 from 40 to 50 dBZ, level 4 at 50 dBZ and above. Because log is43 monotonic, the linear Z thresholds 1000 / 10000 / 100000 mm6/m3 mark44 the same band edges.45- RTCA DO-185 frames the airborne weather radar MOPS context. The46 relations above are standard engineering methodology, summary-only.4748## Workflow49501. Convert rainfall to reflectivity with reflectivity_from_rainfall51 (Z = a * R^b) when the input is a rain rate, or invert with52 rainfall_from_reflectivity when the radar reports Z.532. Confirm the conversion round-trips: the inverse of the forward value54 returns the starting rate within 1e-6 relative.553. Point the beam: tilt_to_cell_top(own_altitude_m, cell_top_altitude_m,56 slant_range_m) returns the elevation tilt that puts the beam axis on57 the cell top. Negative tilt means the cell lies below the aircraft.584. Get the displayed range: ground_range_from_slant(slant_range_m,59 own_altitude_m, target_altitude_m) with the default 0 m target for the60 surface reference.615. Check the tilt against terrain: clutter_check(tilt_deg,62 own_altitude_m, slant_range_m, terrain_elevation_m, beam_width_deg)63 returns the beam lowest edge and the clutter verdict.646. Rate the echo: echo_level(reflectivity) returns the standard four65 level category for the cockpit weather display.667. For the full operating point in one call, run67 weather_radar_assessment(rainfall_mm_h, own_altitude_m,68 cell_top_altitude_m, slant_range_m, terrain_elevation_m,69 beam_width_deg) and read the six documented keys.708. Confirm the deterministic checks with the contract test71 scripts/test_airborne_weather_radar.py.7273## Worked example7475Rainfall 20 mm/h, own altitude 3048 m (10 000 ft), cell top 12 192 m76(40 000 ft), slant range 111 120 m (60 NM), terrain 0 m, beam width 3 deg.7778- Reflectivity: Z = 200 * 20^1.6 = 24 136.71 mm6/m3 (43.83 dBZ), inside79 the 20 000 to 28 000 bound. At 50 mm/h the value is 104 563.96 mm6/m3,80 inside the 90 000 to 120 000 bound.81- Rainfall round trip: rainfall_from_reflectivity(24 136.71) returns82 20.00 mm/h, within 1% (1e-6 relative) of the input.83- Tilt to cell top: atan(9144 / 111 120) = 4.704 deg, inside the 3.5 to84 6.0 deg bound (the cell top 9144 m above the aircraft).85- Ground range: sqrt(111 120^2 - 3048^2) = 111 078.19 m, within 0.5% of86 the slant range (displayed range is nearly the slant range at high87 altitude).88- Clutter check: beam lowest edge 4.704 - 1.5 = 3.204 deg above the89 horizon. The terrain angle at 111 120 m is atan(-3048 / 111 120) =90 -1.57 deg, so the beam is clear of the ground and clutter_verdict is91 False.92- Echo level: 24 136.71 mm6/m3 sits in the 40 to 50 dBZ band, so93 echo_level returns 3.9495## Verification9697- Reflectivity at 20 mm/h stays in 20 000 to 28 000 mm6/m3 and at98 50 mm/h in 90 000 to 120 000 mm6/m3; tilt stays in 3.5 to 6.0 deg;99 ground range stays within 0.5% of the slant range.100- Round trip: the Z-R inverse of the forward value returns the input101 rate within 1e-6 relative for any rate.102- Monotonicity: reflectivity rises with rainfall and tilt rises as the103 cell top rises.104- Clutter verdict flips True when the terrain angle exceeds the beam105 lowest edge (terrain 1000 m at 5000 m range from own 500 m with 0 deg106 tilt returns True).107- Every non-physical input raises ValueError: negative rainfall or108 reflectivity, a <= 0, b <= 0, slant range <= 0, beam width <= 0, and a109 slant range shorter than the altitude difference in110 ground_range_from_slant.111- Determinism: no RNG anywhere, run-to-run identical floats.112- Run the contract test offline: python3113 scripts/test_airborne_weather_radar.py (32 tests, deterministic).114115## Related leaves116117- avionics/surveillance/ads-b-surveillance: the broadcast surveillance118 sibling for air-to-air position and velocity performance, which owns119 the automatic dependent surveillance broadcast link.120- avionics/surveillance/tcas-resolution-advisory: the collision avoidance121 sibling, which owns resolution advisory decision making and its own122 surveillance logic.123124## Pitfalls125126- Replacing the module's Z-R constants: the reflectivity conversion127 uses Z = 200.0 * R^1.6 (A_DEFAULT, B_DEFAULT) - swapping in another128 Marshall-Palmer pair (say 300/1.4 for convective rain) without129 touching the module constants changes every reflectivity, echo130 level, and round trip this leaf reports.131- Comparing across the dBZ and linear scales: the echo bands are132 30 / 40 / 50 dBZ, which log-monotonically match the linear Z133 thresholds 1000 / 10000 / 100000 mm6/m3 - a rate compared as linear134 Z against a dBZ band edge mis-ranks the echo level.135- Forgetting the tilt can go negative: tilt is atan((cell_top - own) /136 slant_range), so a cell top below the aircraft gives a downward137 pointing beam - the altitude difference is signed and a negative138 tilt is a valid operating point, not an input error.139- Applying earth curvature to the displayed range: the model is140 flat-earth, ground = sqrt(slant^2 - (own - target)^2), and141 RE_ARTH = 6371000.0 m is informational only - at high altitude the142 displayed range is nearly the slant range (111 078.19 m from a143 111 120 m slant), and a slant range shorter than the altitude144 difference raises ValueError instead of returning an imaginary145 square root.146- Reversing the clutter comparison: clutter exists when the beam's147 lowest edge (tilt - beam_width / 2) lies below the terrain angle,148 because the beam still illuminates the ground - the worked example149 is clear (3.204 deg edge above a -1.57 deg terrain angle), and the150 verdict flips True only when the terrain angle rises above the151 edge, as in the 1000 m terrain case at 5000 m.152- Slipping the echo band edges: level 2 spans 30 to 40 dBZ, level 3153 spans 40 to 50 dBZ, and level 4 starts at 50 dBZ - the 24 136.71154 mm6/m3 worked echo (43.83 dBZ) is level 3, and boundary reflectivity155 must be graded on the linear threshold 1000 / 10000 / 100000, not a156 rounded dBZ guess.157158## Behavior contract (gate 3)159160Run the deterministic contract test (stdlib unittest, offline):161162 python3 scripts/test_airborne_weather_radar.py163164The test covers the worked-example contract (reflectivity values and165magnitude bounds, tilt and ground range real outputs, clutter lowest edge166and verdict, echo level 3), the Z-R round trip within 1e-6 relative, both167monotonicity directions, echo level band edges at 30 / 40 / 50 dBZ,168clutter verdict truth and toggling geometry, exact convenience-chain keys,169determinism, float output types, module constants, and ValueError170rejection of every non-physical input in the spec validation list.171172## Compliance173174- RTCA DO-185 (airborne weather radar MOPS) is referenced, reference-only175 and gated in standards-map.yaml: no test text or proprietary tables are176 reproduced. The Marshall-Palmer Z-R relation and the geometry above are177 standard engineering methodology, summary-only.178- compliance: STANDARDS-REF, gated: false.