max windchill active only in winds > 1.2m/s
[dweather.git] / loop.pl
diff --git a/loop.pl b/loop.pl
index f19b48041a62a784bfdee996e2a47b347c4be082..d5f69a5a4cb5230a6346781e1c040f92f450d61d 100755 (executable)
--- a/loop.pl
+++ b/loop.pl
@@ -448,6 +448,9 @@ sub process
                        ++$writeld;
                }
 
+               my $wkph = $wind->{w} * 3.6;
+               $h{WindChill} = nearest(0.1, $wind->{w} >= 1.2 ? 13.12 + 0.6215 * $temp - 11.37 * $wkph ** 0.16 + 0.3965 * $temp * $wkph ** 0.16 : $temp); 
+
                if ($ts >= $ld->{last_hour} + 1800) {
                        $h{Pressure_Trend}    = unpack("C", substr $blk,3,1);
                        $h{Pressure_Trend_txt} = $bar_trend{$h{Pressure_Trend}};