Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

THW and THSW index
#4

Hi,

So I had to write a php script myself. And it seems that it even works (he's so terribly simple).  Smile

[Image: THWandTHSWindex.jpg]

If anyone would be sitting on this "piece", I attach the code. I just remind you that it's for CumulusMX
to place it into html code on your local server (Raspbian???). From the script, it's possible to throw away
many things (definition of empty variables, calculation of what I do not need, comments, etc.).
 
Code:
<?php
//
/* THW and THSW calculation*/
//
$Ta = <#temp>;          /* Dry bulb temperature [°C] */
$e = 0;                 /* Watter vapour pressure [hPa] (humidity) */
$ws = <#wspeed>;        /* Wind speed [m/s] at an elevation of 10 meters */
$rh = <#hum>;           /* Relative humidity [%] */
$Q = <#SolarRad>;       /* Net radiation absorbed per unit area of body surface [w/m2] */
$ATthw = 0;             /* Temperature - humidity - wind index */
$ATthsw = 0;            /* Temperature - humidity - solar - wind index */
//
$e = ($rh / 100) * 6.105 * exp (17.27 * $Ta / (237.7 + $Ta));
//
$ATthw = $Ta + 0.33 * $e - 0.70 * $ws - 4.00;
$ATthwr = round($ATthw, 1);
//
$ATthsw = $Ta + 0.348 * $e - 0.70 * $ws + 0.70 * $Q / ($ws + 10) - 4.25;
$ATthswr = round($ATthsw, 1);
//
echo "$ATthwr"."<br />";
echo "$ATthswr"."<br />";
?>

Best Regards
Zdenek

Brandys/L Weather
Reply


Messages In This Thread
THW and THSW index - by hornychz - 24-10-2017, 18:17
RE: THW and THSW index - by laulau - 24-10-2017, 22:39
RE: THW and THSW index - by hornychz - 25-10-2017, 05:26
RE: THW and THSW index - by hornychz - 31-10-2017, 19:12
RE: THW and THSW index - by danner - 02-11-2017, 06:33
RE: THW and THSW index - by Segall - 02-11-2017, 09:21
RE: THW and THSW index - by hornychz - 11-12-2021, 23:55



Users browsing this thread: 1 Guest(s)