1
0
Fork 0

Tentative bugfix for AW not considering gusty follow-up METAR reports

This commit is contained in:
Thorsten Renk 2015-01-14 10:04:42 +02:00
parent 776a6552b5
commit a401041637
2 changed files with 16 additions and 6 deletions

View file

@ -910,8 +910,15 @@ if (gust_frequency > 0.0)
var gust_relative_strength = getprop(lw~"tmp/gust-relative-strength"); var gust_relative_strength = getprop(lw~"tmp/gust-relative-strength");
var gust_angvar = getprop(lw~"tmp/gust-angular-variation-deg"); var gust_angvar = getprop(lw~"tmp/gust-angular-variation-deg");
# var winddir_last = getprop(lwi~"wind-from-heading-deg"); # if we have variability in the direction of the wind, the winds will
var winddir_last = interpolated_conditions.wind_from_heading_deg; # drift by the Markov chain code below to adjust to a new winddir as computed
# above - however if the wind is not variable but still gusty, this won't happen
# so we have to take care of it explicitly
if (gust_angvar > 0.0)
{var winddir_last = interpolated_conditions.wind_from_heading_deg;}
else
{var winddir_last = winddir;}
var alt_scaling_factor = 1.2 * windspeed / 10.0; var alt_scaling_factor = 1.2 * windspeed / 10.0;
if (alt_scaling_factor < 1.0) {alt_scaling_factor = 1.0;} if (alt_scaling_factor < 1.0) {alt_scaling_factor = 1.0;}
@ -946,6 +953,8 @@ if (gust_frequency > 0.0)
compat_layer.setWindSmoothly(winddir, windspeed_current); compat_layer.setWindSmoothly(winddir, windspeed_current);
# set the interpolated conditions to the wind including gust
interpolated_conditions.wind_from_heading_deg = winddir; interpolated_conditions.wind_from_heading_deg = winddir;
interpolated_conditions.windspeed_kt = windspeed_current; interpolated_conditions.windspeed_kt = windspeed_current;

View file

@ -2747,9 +2747,9 @@ var set_METAR_weather_station = func {
if ((alpha == 0.0) and (windspeed == 0.0)) if ((alpha == 0.0) and (windspeed == 0.0))
{ {
alpha = getprop(lw~"tmp/tile-orientation-deg"); alpha = getprop(lw~"tmp/tile-orientation-deg");
var phi = alpha * math.pi/180.0; #var phi = alpha * math.pi/180.0;
} }
#print("Adding wind interpolation.");
var boundary_correction = 1.0/local_weather.get_slowdown_fraction(); var boundary_correction = 1.0/local_weather.get_slowdown_fraction();
local_weather.set_wind_ipoint_metar(station_lat, station_lon, alpha, boundary_correction * windspeed); local_weather.set_wind_ipoint_metar(station_lat, station_lon, alpha, boundary_correction * windspeed);
@ -2773,8 +2773,9 @@ var set_METAR_weather_station = func {
setprop(lw~"tmp/gust-relative-strength", gust_relative_strength); setprop(lw~"tmp/gust-relative-strength", gust_relative_strength);
setprop(lw~"tmp/gust-angular-variation-deg", gust_angvar); setprop(lw~"tmp/gust-angular-variation-deg", gust_angvar);
setprop(lw~"METAR/wind-direction-deg", alpha);
setprop(lw~"METAR/windspeed-kt", windspeed);
#print("Added METAR station with wind direction ", alpha, " and strength ", windspeed);
# and mark that we have used this station # and mark that we have used this station
setprop(lw~"METAR/station-id",getprop("/environment/metar/station-id")); setprop(lw~"METAR/station-id",getprop("/environment/metar/station-id"));