// CU Sample= '2013/12/28 14:12' $JSONdata['hourlyrainTH'] = $wflash2[255]; // CU Sample= '0.000' $JSONdata['ThumTL'] = fixupTime($wflash2[118]); // WD Sample= '3:22 PM' $JSONdata['ThumTH'] = fixupTime($wflash2[62]); // WD Sample= '8:05 AM' $JSONdata['TinhumTL'] = fixupTime($wflash2[117]); // WD Sample= '3:22 PM' $JSONdata['TinhumTH'] = fixupTime($wflash2[61]); // WD Sample= '8:05 AM' $JSONdata['TpressTL'] = fixupTime($wflash2[136]); // WD Sample= '2:18 PM' $JSONdata['TpressTH'] = fixupTime($wflash2[80]); // WD Sample= '10:09 AM' $JSONdata['presstrendval'] = convertBaro($wflash[53], $uomBaro); // CU Sample= '-0.019' $JSONdata['Tbeaufort'] = getBeaufort($wflash[4]); // WD Sample = '3', CU Sample= 'F3' $JSONdata['TwgustTM'] = fixupTime($wflash2[60]); // WD Sample= '2:19 PM' $JSONdata['windTM'] = convertWind($wflash2[3], $uomWind); // CU Sample= '6.2' $JSONdata['bearingTM'] = round($wflash2[2]); // CU Sample= '315' $fixedTimestamp = strtotime(fixupDate($wflash2[275], $WDdateMDY) . ' ' . $JSONdata['date']); $JSONdata['timeUTC'] = gmdate('Y,m,d,H,i,s', $fixedTimestamp); // WD/CU Sample= '2013,01,20,23,39,59' $JSONdata['BearingRangeFrom10'] = '359'; // CU Sample= '289' $JSONdata['BearingRangeTo10'] = '0';
function baro_stats($arr, $col) { //Returns array $return with Hi Lo & Ave in [0],[1]&[2] //Each of those is an array with mb in 0 and inches in 1 $hi = $arr[0][$col]; $lo = $arr[0][$col]; $tot = 0; for ($row = 0; $row < count($arr); $row++) { $tot = $tot + $arr[$row][$col]; if ($arr[$row][$col] > $hi) { $hi = $arr[$row][$col]; } if ($arr[$row][$col] < $lo) { $lo = $arr[$row][$col]; } } $return[0] = convertBaro($hi); $return[1] = convertBaro($lo); $return[2] = convertBaro(round($tot / count($arr), 1)); return $return; }