Changeset 9
- Timestamp:
- 02/18/09 17:36:59 (3 years ago)
- Files:
-
- 1 modified
-
weatherstats/weatherstats (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
weatherstats/weatherstats
r6 r9 9 9 # WeatherStats 10 10 # 11 # version: 0. 511 # version: 0.6 12 12 # 13 13 # author: Adam Pribyl, covex@lowlevel.cz … … 193 193 if ($atribute eq "direction") { 194 194 $scale = ${$hasharray{$atribute}}[2]; 195 $arguments = $arguments."DEF:".$atribute."=".$rrdbp.$wname."_".$atribute.".rrd:".$atribute.":MAX "; 195 if ($gtime = "24h") { 196 $arguments = $arguments."DEF:".$atribute."=".$rrdbp.$wname."_".$atribute.".rrd:".$atribute.":AVERAGE "; 197 } else { 198 $arguments = $arguments."DEF:".$atribute."=".$rrdbp.$wname."_".$atribute.".rrd:".$atribute.":MAX "; 199 } 196 200 $arguments = $arguments."CDEF:North=".$atribute.",0,GE,-4,* "; 197 201 $arguments = $arguments."CDEF:NNE=".$atribute.",1,GE,-4,* "; … … 291 295 $date = `date`; 292 296 print INDEX "<p>Generated: ".$date."</p>\n"; 297 print INDEX "<p>Station altitude: <span class=\"wvalue\">".$altitude."</span><span class=\"wscale\">mnm</span></p>\n"; 293 298 } 294 299 … … 480 485 $value = ${$wind{'speed'}}[1]; 481 486 $tout = ${$temperature{'outdoor'}}[1]; 482 # windchill calculation is only valid for wind speed > 4.5km/h ~ 1.25m/s 483 if ($value > 1.25) { 484 $ws = $value**0.16; 487 # windchill calculation is only valid for wind speed > 4.5km/h ~ 1.25m/s and $tout < 10C 488 if ($value > 1.25 and $tout < 10) { 489 #Convert $value=m/s $ws=km/h 490 $ws=$value*3.6; 491 $ws = $ws**0.16; 485 492 #Wind chill 486 493 $twc = 13.12+(0.6215*$tout)-(11.37*($ws))+((0.3965*$tout)*($ws));