WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: PSJohn on July 27, 2019, 01:58:32 PM

Title: Radomir's wxwugraphs - Hourly Dewpoint Calculations
Post by: PSJohn on July 27, 2019, 01:58:32 PM
Anyone ever notice that the hourly temp/DP graph does not calculate the Dewpoint correctly from the clientrawhour.txt file? Currently it is off by +8°. The daily graph shows correctly. checked the clientrawhour.txt file and it is correct.

here is the calculation in the file:
Code: [Select]
    // dewpoint calculation
    $c = 0;
    foreach ($temp as $val) {
      $gtrh = ((17.271*$val)/(237.7+$val))+log($humi[$c]/100);
      $dewp[] = round((237.7*$gtrh)/(17.271-$gtrh), 1);
      //$dewp[] = $val-((100-$humi[$c])/5); // low accuracy (+/- 1degC and more under of 50% humidity)
      $chdewp[] = round((237.7*$gtrh)/(17.271-$gtrh), 1);
      $c++; 
    }

I'm not smart enough to check it!  :roll: