Monthly Climatological Summary
Données mensuelles ' . $months[$month -1 ] . ' ' . $year . '
'; echo '
Jour | Temp max °C | Temp min °C | Temp moy. °C |
Déficit DJU | Exédent DJU |
Press min (mb) | Press max (mb) |
Rafale max (km/h) | Vent Dominant | Parcours (km) |
Pluie (mm) | Averse mm/hr | '.
'Hum max (%) | Hum min (%) | Srad max (W/m2) | '
;
$NbJours = count($data['jour']);
$wdirm =0;
$winddir = array ("N"=> 0, "NE"=> 0, "E"=> 0, "SE"=> 0, "S"=> 0, "SO" => 0, "O"=> 0, "NO"=> 0,"NNO"=> 0, "NNE"=> 0, "ENE"=> 0, "ESE"=> 0, "SSE"=> 0, "SSO" => 0, "OSO"=> 0, "ONO"=> 0);
// Read the array now looking for data in the data set we want
for($i = 0; $i < $NbJours; $i++) {
// Check to see if this is in the date data set
// Date
echo '
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
' . $data['jour'][$i] . ' | '; // Temps echo '' . number_format($data['tmax'][$i],1) . ' | ' . number_format($data['tmin'][$i],1) . ' | ' . number_format($data['tavg'][$i],1) . ' | '; // Deg day echo '' . number_format($data['hdd'][$i],1) . ' | ' . number_format($data['cdd'][$i],1) . ' | '; // Pressure echo '' . $data['pmax'][$i] . ' | ' . $data['pmin'][$i] . ' | '; // Wind echo '' . $data['ventr'][$i] . ' | ' . windDir($data['vdir'][$i]) . ' | ' . $data['ventt'][$i] . ' | '; $wdirm += ($data['vdir'][$i])*$data['ventt'][$i]; $dir = windDir($data['vdir'][$i]); if ($data['ventt'][$i] > 0) $winddir[$dir]++; // Rain echo '' . $data['pluie'][$i] . ' | ' . $data['averse'][$i] . ' | '; // Hum echo '' . $data['hmax'][$i] . ' | ' . $data['hmin'][$i] . ' | '; // Solar echo '' . $data['srad'][$i] . ' | '; echo '
' .'Extr.'. ' | '; // Temps echo '' . number_format($data['tmaxM'],1) . ' | ' . number_format($data['tminM'],1) . ' | ' . number_format($data['tavgM'],1) . ' | '; // Deg day echo '' . number_format($data['hddM'],1) . ' | ' . number_format($data['cddM'],1) . ' | '; // Pressure echo '' . $data['pmaxM'] . ' | ' . $data['pminM'] . ' | '; // Wind foreach($winddir as $k => $v){ if($v == (max($winddir))){ // see if number of occurences = max $dirD = $k; // sort of put back into a degree range } } echo '' . $data['ventrM'] . ' | ' . $dirD. ' | ' . $data['venttM'] . ' | '; // Rain echo '' . $data['pluieM'] . ' | ' . $data['averseM'] . ' | '; // Hum echo '' . $data['hmaxM'] . ' | ' . $data['hminM'] . ' | '; // Solar echo '' . $data['sradM'] . ' | '; echo '
Sorry, there is no data found for " . $months[$month -1 ] . ' ' . $year . "
"; } } // Return the array position of the variable function ret_val($lookup) { global $SITE; $rtn = array_search ( $lookup , $SITE['dfields'] ); if ($rtn !== FALSE) { return( $rtn ); } else { return("-"); } } // Return the array position of the variable function ret_rval($lookup) { global $SITE, $data; $rtn = array_search ( $lookup , $SITE['rfields'] ); if ($rtn !== FALSE) { return( $data[$rtn] ); } else { return("-"); } } // Standard Source view option check function check_sourceview () { global $SITE; if ( isset($_GET['view']) && $_GET['view'] == 'sce' ) { $filenameReal = __FILE__; $download_size = filesize($filenameReal); header('Pragma: public'); header('Cache-Control: private'); header('Cache-Control: no-cache, must-revalidate'); header("Content-type: text/plain"); header("Accept-Ranges: bytes"); header("Content-Length: $download_size"); header('Connection: close'); readfile($filenameReal); exit; } } // Calculate Word WinDir from Bearing function windDir ($winddir) { if (!isset($winddir)) { return "---"; } $windlabel = array ("N","NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSO","SO", "OSO", "O", "ONO", "NO", "NNO"); $dir = $windlabel[ fmod((($winddir + 11) / 22.5),16) ]; return "$dir"; } function windDir8 ($winddir) { if (!isset($winddir)) { return "---"; } $windlabel = array ("N", "NE", "E", "SE", "S", "SO", "O", "NO"); $dir = $windlabel[ fmod((($winddir + 22.5) / 45),8) ]; return "$dir"; } // Function to read the data file with the // Delimiter provided function get_raw( $rawfile , $del ) { $rawdata = array(); $fd = fopen( $rawfile, "r" ); if ( $fd ) { $rawinfo = ''; while (! feof ( $fd ) ) { $rawinfo .= fread( $fd, 8192 ); } fclose($fd); $rawdata = explode ( $del, $rawinfo ); } else { $rawdata[0]= -9999; } return $rawdata; } ############################################################################ # End of Module ############################################################################ ?>