Add layer descriptions to weather map control panel

This commit is contained in:
Graham McIntire 2026-04-03 17:21:02 -05:00
parent bf8c6d4789
commit f411045242
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -13,23 +13,38 @@ defmodule MicrowavepropWeb.WeatherMapLive do
@layers [
# Surface
%{id: "temperature", label: "Temperature", unit: "°C", group: "Surface"},
%{id: "dewpoint_depression", label: "Td Depression", unit: "°C", group: "Surface"},
%{id: "surface_rh", label: "Humidity", unit: "%", group: "Surface"},
%{id: "pwat", label: "PWAT", unit: "mm", group: "Surface"},
%{id: "surface_refractivity", label: "Refractivity", unit: "N", group: "Surface"},
%{id: "refractivity_gradient", label: "N-Gradient", unit: "N/km", group: "Surface"},
%{id: "bl_height", label: "BL Height", unit: "m", group: "Surface"},
%{id: "temperature", label: "Temperature", unit: "°C", group: "Surface",
desc: "2m air temperature. Warm, humid air increases refractivity and ducting potential at lower frequencies."},
%{id: "dewpoint_depression", label: "Td Depression", unit: "°C", group: "Surface",
desc: "Temperature minus dewpoint. Small values (< 5°C) mean moist boundary layer — favorable for ducting at 10 GHz, but increases absorption above 24 GHz."},
%{id: "surface_rh", label: "Humidity", unit: "%", group: "Surface",
desc: "Relative humidity from surface T and Td. High RH supports refractivity gradients that bend microwave signals."},
%{id: "pwat", label: "PWAT", unit: "mm", group: "Surface",
desc: "Precipitable water — total moisture in the atmospheric column. High values signal rain fade risk for 24 GHz and above."},
%{id: "surface_refractivity", label: "Refractivity", unit: "N", group: "Surface",
desc: "Radio refractivity (N-units) at the surface. Typical values 280380. Higher N means the atmosphere bends signals more toward the ground."},
%{id: "refractivity_gradient", label: "N-Gradient", unit: "N/km", group: "Surface",
desc: "Minimum refractivity gradient in the profile. Standard is 40 N/km. Below 157 N/km signals are trapped in a duct. More negative = stronger ducting."},
%{id: "bl_height", label: "BL Height", unit: "m", group: "Surface",
desc: "Planetary boundary layer height. Shallow BL (< 500m) concentrates moisture and heat near the surface, favoring temperature inversions and ducting."},
# Upper Air
%{id: "temp_850mb", label: "T @ 850mb", unit: "°C", group: "Upper Air"},
%{id: "dewpoint_850mb", label: "Td @ 850mb", unit: "°C", group: "Upper Air"},
%{id: "lapse_rate", label: "Lapse Rate", unit: "°C/km", group: "Upper Air"},
%{id: "inversion_strength", label: "Inversion", unit: "°C", group: "Upper Air"},
%{id: "inversion_base_m", label: "Inv. Base", unit: "m", group: "Upper Air"},
%{id: "temp_850mb", label: "T @ 850mb", unit: "°C", group: "Upper Air",
desc: "Temperature at 850 mb (~1500m altitude). Warm 850mb air over cool surface air indicates a capping inversion — a classic ducting setup."},
%{id: "dewpoint_850mb", label: "Td @ 850mb", unit: "°C", group: "Upper Air",
desc: "Dewpoint at 850 mb. A sharp moisture drop between the surface and 850mb creates an elevated refractivity gradient that can form ducts."},
%{id: "lapse_rate", label: "Lapse Rate", unit: "°C/km", group: "Upper Air",
desc: "Temperature decrease per km from surface to 700mb. Low rates (< 5 °C/km) mean stable air that preserves inversions. High rates (> 8) mean convective mixing that destroys them."},
%{id: "inversion_strength", label: "Inversion", unit: "°C", group: "Upper Air",
desc: "Strongest temperature increase between adjacent levels. Inversions trap microwave signals. > 3°C is significant, > 5°C is strong."},
%{id: "inversion_base_m", label: "Inv. Base", unit: "m", group: "Upper Air",
desc: "Height (m AGL) where the strongest inversion begins. Surface-based inversions (< 200m) create surface ducts. Elevated inversions create elevated ducts."},
# Ducting
%{id: "ducting", label: "Ducting", unit: "", group: "Ducting"},
%{id: "duct_base_m", label: "Duct Base", unit: "m", group: "Ducting"},
%{id: "duct_strength", label: "Duct Strength", unit: "M", group: "Ducting"}
%{id: "ducting", label: "Ducting", unit: "", group: "Ducting",
desc: "Whether a trapping layer (modified refractivity decreasing with height) was detected in the profile. Green = duct present, signals can travel far beyond line of sight."},
%{id: "duct_base_m", label: "Duct Base", unit: "m", group: "Ducting",
desc: "Height of the lowest duct base. Surface ducts (< 100m) are most effective for ground-based stations. Elevated ducts require antennas near the duct height."},
%{id: "duct_strength", label: "Duct Strength", unit: "M", group: "Ducting",
desc: "Duct trapping strength in modified refractivity (M) units. > 10 M is moderate, > 20 M is strong. Stronger ducts trap a wider range of frequencies."}
]
@impl true
@ -99,6 +114,13 @@ defmodule MicrowavepropWeb.WeatherMapLive do
|> Enum.sort_by(fn {group, _} -> Enum.find_index(@group_order, &(&1 == group)) || 99 end)
end
defp layer_description(layers, selected_id) do
case Enum.find(layers, &(&1.id == selected_id)) do
%{desc: desc} -> desc
_ -> nil
end
end
@impl true
def render(assigns) do
~H"""
@ -163,6 +185,11 @@ defmodule MicrowavepropWeb.WeatherMapLive do
</div>
</div>
<%!-- Layer description --%>
<div class="text-xs opacity-70 px-1 leading-snug">
{layer_description(@layers, @selected_layer)}
</div>
<%!-- Links --%>
<div class="flex flex-col gap-1 border-t border-base-300 pt-2">
<.link navigate="/map" class="btn btn-xs btn-ghost justify-start gap-1.5">