feat(contacts): surface tropo duct count and suggest-edit hint
Propagation analysis panel now adds a "Tropo duct detected at N/M HRRR samples along the path" line whenever any HRRR sample flags ducting, even if the overall mechanism classification doesn't end up pointing at the duct (e.g. short paths, clear-LoS contacts). Also rewords the map caveat to invite users with better coordinates to file a suggested edit — clickable when logged in, otherwise a login link.
This commit is contained in:
parent
bccc0b66c1
commit
7330d64c5a
1 changed files with 33 additions and 3 deletions
|
|
@ -895,7 +895,25 @@ defmodule MicrowavepropWeb.ContactLive.Show do
|
|||
|
||||
<%= if @contact.pos1 && @contact.pos2 do %>
|
||||
<p class="text-xs text-base-content/50 italic mb-1">
|
||||
Locations approximate, in the center of the grid squares
|
||||
Locations approximate, in the center of the grid squares.
|
||||
<%= if current_user(assigns) do %>
|
||||
Have more detailed position information?
|
||||
<button
|
||||
type="button"
|
||||
phx-click="toggle_edit"
|
||||
class="link link-hover not-italic text-base-content/70"
|
||||
>
|
||||
Suggest an edit
|
||||
</button>
|
||||
<% else %>
|
||||
Have more detailed position information?
|
||||
<.link
|
||||
navigate={~p"/users/log-in"}
|
||||
class="link link-hover not-italic text-base-content/70"
|
||||
>
|
||||
Log in to suggest an edit
|
||||
</.link>
|
||||
<% end %>
|
||||
</p>
|
||||
<div
|
||||
id="contact-map"
|
||||
|
|
@ -1917,7 +1935,7 @@ defmodule MicrowavepropWeb.ContactLive.Show do
|
|||
|
||||
{factors, factor_rows, composite} = compute_factors(hrrr_path, contact, band_config)
|
||||
summary = build_summary(terrain, elevation_profile, hrrr, soundings, dist_km, band_mhz)
|
||||
details = build_details(hrrr, soundings, elevation_profile, band_mhz)
|
||||
details = build_details(hrrr, hrrr_path, soundings, elevation_profile, band_mhz)
|
||||
|
||||
%{
|
||||
summary: summary,
|
||||
|
|
@ -2114,11 +2132,12 @@ defmodule MicrowavepropWeb.ContactLive.Show do
|
|||
|
||||
defp band_summary(_, _), do: nil
|
||||
|
||||
defp build_details(hrrr, soundings, elevation_profile, _band_mhz) do
|
||||
defp build_details(hrrr, hrrr_path, soundings, elevation_profile, _band_mhz) do
|
||||
Enum.reject(
|
||||
[
|
||||
refractivity_detail(hrrr),
|
||||
boundary_layer_detail(hrrr),
|
||||
path_duct_count_detail(hrrr_path),
|
||||
sounding_ducting_detail(soundings),
|
||||
duct_layer_detail(elevation_profile)
|
||||
],
|
||||
|
|
@ -2126,6 +2145,17 @@ defmodule MicrowavepropWeb.ContactLive.Show do
|
|||
)
|
||||
end
|
||||
|
||||
defp path_duct_count_detail(hrrr_path) when is_list(hrrr_path) and hrrr_path != [] do
|
||||
total = length(hrrr_path)
|
||||
ducting = Enum.count(hrrr_path, &(&1 && &1.ducting_detected))
|
||||
|
||||
if ducting > 0 do
|
||||
"Tropo duct detected at #{ducting}/#{total} HRRR samples along the path."
|
||||
end
|
||||
end
|
||||
|
||||
defp path_duct_count_detail(_), do: nil
|
||||
|
||||
defp refractivity_detail(%{min_refractivity_gradient: grad}) when is_number(grad) do
|
||||
g = round(grad)
|
||||
label = refractivity_label(g)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue