Recompute elevation profile with duct data when soundings arrive

This commit is contained in:
Graham McIntire 2026-04-02 10:25:42 -05:00
parent bffe3616b5
commit 43f7bcf3c8
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59

View file

@ -164,21 +164,17 @@ defmodule MicrowavepropWeb.ContactLive.Show do
hrrr_path = Weather.hrrr_profiles_for_path(contact)
hrrr = List.first(hrrr_path)
terrain = socket.assigns.terrain
elevation_profile = socket.assigns.elevation_profile
# Recompute propagation analysis with new sounding data (duct detection)
propagation_analysis =
if elevation_profile || hrrr do
build_propagation_analysis(contact, hrrr, terrain, elevation_profile, soundings)
else
socket.assigns.propagation_analysis
end
# Recompute elevation profile with new sounding duct data
elevation_profile = compute_elevation_profile(contact, hrrr_path, soundings)
propagation_analysis = build_propagation_analysis(contact, hrrr, terrain, elevation_profile, soundings)
{:noreply,
assign(socket,
surface_observations: weather.surface_observations,
soundings: soundings,
weather_status: :loaded,
elevation_profile: elevation_profile,
propagation_analysis: propagation_analysis
)}
end