max windchill active only in winds > 1.2m/s
authorDirk Koopman <djk@tobit.co.uk>
Tue, 19 Jan 2016 17:49:10 +0000 (17:49 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 19 Jan 2016 17:49:10 +0000 (17:49 +0000)
loop.pl
templates/index.html.ep

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}};
index e1bf922e542ffdb77d7e1efd80e7df2f530161f9..1cbb94914967bc115f586934944e9ec2f6e1c852 100644 (file)
                                                           }
                                                   }
                                                   chop $s if length $s; 
-                                                  say $s;
                                                %><%= $s %>
                                        ],
                                        tooltip: {
                                                           }
                                                   }
                                                   chop $s if length $s; 
-                                                  say $s;
                                                %><%= $s %>
                                        ],
                                        tooltip: {
                                        <tr><th>Wind:</th><td><span id="Dir"> </span> ° @ <span id="Wind"> </span> mph</td>
                                                <th>Wind Minute Avg:</th><td> <span id="Dir_1m"> </span> ° @ <span id="Wind_1m"> </span> mph </td>
                                                <th>Day Max Speed:</th><td> <span id="Wind_Max"> </span> mph @ <span id="Wind_Max_T"> </span></td>
+                                               <th>Wind Chill:</th><td> <span id="WindChill"> °C</span></td>
                                        </tr>
                                        <tr>
                                                <th>Rain 30mins:</th><td> <span id="Rain_1h"> </span> mm</td>