From ab9805ca9b7cd3129d6b85b650df62d71906e3c1 Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Wed, 5 Sep 2018 09:27:44 +0300 Subject: [PATCH] AW: Fix bad vertical visibility profile determination for high clouds in METAR --- Nasal/local_weather/weather_tiles.nas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Nasal/local_weather/weather_tiles.nas b/Nasal/local_weather/weather_tiles.nas index d19f1cc72..e88ea6445 100644 --- a/Nasal/local_weather/weather_tiles.nas +++ b/Nasal/local_weather/weather_tiles.nas @@ -2378,6 +2378,7 @@ var alt_low = layers[0].getNode("elevation-ft").getValue(); if ((alt_low < 0.0) or (cover_low ==0)) # we have to guess a value for the convective altitude for the visibility model {alt_low = 8000.0;} + # first check a few obvious criteria if (cover_low == 8) {cumulus_flag = 0;} # overcast sky is unlikely to be Cumulus, and we can't render it anyway @@ -2745,6 +2746,14 @@ var set_METAR_weather_station = func { {ovcst_alt = layer_alt3; ovcst = ovcst + rand() * 0.1;} if (layer_alt4 > 20000.0) {ovcst_alt = layer_alt4; ovcst = ovcst + rand() * 0.1;} + + + # visibility model requires to separate the two + if (alt_shade >= ovcst_alt - 2000.0) + {ovcst_alt = alt_shade + 2000.0;} + + + #print ("Alt_shade: ", alt_shade, " alt ovcst: ", ovcst_alt); # and specify the atmosphere - currently default only