Recompute elevation profile with duct data when soundings arrive
This commit is contained in:
parent
bffe3616b5
commit
43f7bcf3c8
1 changed files with 4 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue