Salut tous le monde.
J'ai eu ce problème. Effectivement, je ne sait pas pourquoi, weatherlink nous sort des directions bizarres.
voici comment j'ai résolu le problème.
Code : Tout sélectionner
// Initialisation (mise à 0 des forces et directions)
$gustN1 = "0.00" ;
$gustN2 = "0.00" ;
$gustN3 = "0.00" ;
$gustN4 = "0.00" ;
$gustN5 = "0.00" ;
$gustN6 = "0.00" ;
$gustN7 = "0.00" ;
$gustNNE1 = "0.00";
$gustNNE2 = "0.00";
$gustNNE3 = "0.00";
$gustNNE4 = "0.00";
$gustNNE5 = "0.00";
$gustNNE6 = "0.00";
$gustNNE7 = "0.00";
$gustNE1 = "0.00";
$gustNE2 = "0.00";
$gustNE3 = "0.00";
$gustNE4 = "0.00";
$gustNE5 = "0.00";
$gustNE6 = "0.00";
$gustNE7 = "0.00";
$gustENE1 = "0.00";
$gustENE2 = "0.00";
$gustENE3 = "0.00";
$gustENE4 = "0.00";
$gustENE5 = "0.00";
$gustENE6 = "0.00";
$gustENE7 = "0.00";
$gustE1 = "0.00";
$gustE2 = "0.00";
$gustE3 = "0.00";
$gustE4 = "0.00";
$gustE5 = "0.00";
$gustE6 = "0.00";
$gustE7 = "0.00";
$gustESE1 = "0.00";
$gustESE2 = "0.00";
$gustESE3 = "0.00";
$gustESE4 = "0.00";
$gustESE5 = "0.00";
$gustESE6 = "0.00";
$gustESE7 = "0.00";
$gustSE1 = "0.00";
$gustSE2 = "0.00";
$gustSE3 = "0.00";
$gustSE4 = "0.00";
$gustSE5 = "0.00";
$gustSE6 = "0.00";
$gustSE7 = "0.00";
$gustSSE1 = "0.00";
$gustSSE2 = "0.00";
$gustSSE3 = "0.00";
$gustSSE4 = "0.00";
$gustSSE5 = "0.00";
$gustSSE6 = "0.00";
$gustSSE7 = "0.00";
$gustS1 = "0.00";
$gustS2 = "0.00";
$gustS3 = "0.00";
$gustS4 = "0.00";
$gustS5 = "0.00";
$gustS6 = "0.00";
$gustS7 = "0.00";
$gustSSO1 = "0.00";
$gustSSO2 = "0.00";
$gustSSO3 = "0.00";
$gustSSO4 = "0.00";
$gustSSO5 = "0.00";
$gustSSO6 = "0.00";
$gustSSO7 = "0.00";
$gustSO1 = "0.00";
$gustSO2 = "0.00";
$gustSO3 = "0.00";
$gustSO4 = "0.00";
$gustSO5 = "0.00";
$gustSO6 = "0.00";
$gustSO7 = "0.00";
$gustOSO1 = "0.00";
$gustOSO2 = "0.00";
$gustOSO3 = "0.00";
$gustOSO4 = "0.00";
$gustOSO5 = "0.00";
$gustOSO6 = "0.00";
$gustOSO7 = "0.00";
$gustO1 = "0.00";
$gustO2 = "0.00";
$gustO3 = "0.00";
$gustO4 = "0.00";
$gustO5 = "0.00";
$gustO6 = "0.00";
$gustO7 = "0.00";
$gustONO1 = "0.00";
$gustONO2 = "0.00";
$gustONO3 = "0.00";
$gustONO4 = "0.00";
$gustONO5 = "0.00";
$gustONO6 = "0.00";
$gustONO7 = "0.00";
$gustNO1 = "0.00";
$gustNO2 = "0.00";
$gustNO3 = "0.00";
$gustNO4 = "0.00";
$gustNO5 = "0.00";
$gustNO6 = "0.00";
$gustNO7 = "0.00";
$gustNNO1 = "0.00";
$gustNNO2 = "0.00";
$gustNNO3 = "0.00";
$gustNNO4 = "0.00";
$gustNNO5 = "0.00";
$gustNNO6 = "0.00";
$gustNNO7 = "0.00";
// Pour chaque directions (1ère boucle if) et pour chaque forces (2ème boucle if) on compte le nombre d'enregistrements
while ($list = mysqli_fetch_assoc($query)) {
$dirvent[$i]=$list['winddir']*1;
$gust[$i]=$list['windgust']*1;
if (($dirvent[$i]==0)||($dirvent[$i]==360)) { // Vent -> N
if ($gust[$i] < 5 ) {$ventN1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventN2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventN3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventN4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventN5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventN6++ ;}
elseif ($gust[$i]>80) {$gustN7++ ;}
;}
elseif (($dirvent[$i]==22) || ($dirvent[$i]==22.5)) { // Vent NNE
if ($gust[$i] < 5 ) {$ventNNE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventNNE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventNNE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventNNE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventNNE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventNNE6++ ;}
elseif ($gust[$i]>80) {$ventNNE7++ ;}
;}
elseif ($dirvent[$i]==45) { // Vent NE
if ($gust[$i] < 5 ) {$ventNE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventNE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventNE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventNE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventNE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventNE6++ ;}
elseif ($gust[$i]>80) {$ventNE7++ ;}
;}
elseif (($dirvent[$i]==67.5) || ($dirvent[$i]==68)) { // Vent ENE
if ($gust[$i] < 5 ) {$ventENE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventENE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventENE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventENE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventENE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventENE6++ ;}
elseif ($gust[$i]>80) {$ventENE7++ ;}
;}
elseif ($dirvent[$i]==90) { // Vent E
if ($gust[$i] < 5 ) {$ventE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventE6++ ;}
elseif ($gust[$i]>80) {$ventE7++ ;}
;}
elseif (($dirvent[$i]==112) || ($dirvent[$i]==112.5)) { // Vent ESE
if ($gust[$i] < 5 ) {$ventESE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventESE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventESE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventESE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventESE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventESE6++ ;}
elseif ($gust[$i]>80) {$ventESE7++ ;}
;}
elseif ($dirvent[$i]==135) { // Vent SE
if ($gust[$i] < 5 ) {$ventSE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventSE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventSE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventSE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventSE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventSE6++ ;}
elseif ($gust[$i]>80) {$ventSE7++ ;}
;}
elseif (($dirvent[$i]==157.5) || ($dirvent[$i]==158)) { // Vent SSE
if ($gust[$i] < 5 ) {$ventSSE1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventSSE2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventSSE3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventSSE4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventSSE5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventSSE6++ ;}
elseif ($gust[$i]>80) {$ventSSE7++ ;}
;}
elseif ($dirvent[$i]==180) { // Vent S
if ($gust[$i] < 5 ) {$ventS1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventS2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventS3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventS4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventS5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventS6++ ;}
elseif ($gust[$i]>80) {$ventS7++ ;}
;}
elseif (($dirvent[$i]==202) || ($dirvent[$i]==202.5)) { // Vent SSO
if ($gust[$i] < 5 ) {$ventSSO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventSSO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventSSO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventSSO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventSSO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventSSO6++ ;}
elseif ($gust[$i]>80) {$ventSSO7++ ;}
;}
elseif ($dirvent[$i]==225) { // Vent SO
if ($gust[$i] < 5 ) {$ventSO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventSO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventSO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventSO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventSO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventSO6++ ;}
elseif ($gust[$i]>80) {$ventSO7++ ;}
;}
elseif (($dirvent[$i]==247.5) || ($dirvent[$i]==248)) { // Vent OSO
if ($gust[$i] < 5 ) {$ventOSO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventOSO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventOSO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventOSO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventOSO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventOSO6++ ;}
elseif ($gust[$i]>80) {$ventOSO7++ ;}
;}
elseif ($dirvent[$i]==270) { // Vent O
if ($gust[$i] < 5 ) {$ventO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventO6++ ;}
elseif ($gust[$i]>80) {$ventO7++ ;}
;}
elseif (($dirvent[$i]==292) || ($dirvent[$i]==292.5)) { // Vent ONO
if ($gust[$i] < 5 ) {$ventONO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventONO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventONO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventONO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventONO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventONO6++ ;}
elseif ($gust[$i]>80) {$ventONO7++ ;}
;}
elseif ($dirvent[$i]==315) { // Vent NO
if ($gust[$i] < 5 ) {$ventNO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventNO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventNO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventNO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventNO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventNO6++ ;}
elseif ($gust[$i]>80) {$ventNO7++ ;}
;}
elseif (($dirvent[$i]==337.5) || ($dirvent[$i]==338)) { // Vent NNO
if ($gust[$i] < 5 ) {$ventNNO1++ ;}
elseif ($gust[$i]>=5 and $gust[$i]<16) {$ventNNO2++ ;}
elseif ($gust[$i]>15 and $gust[$i]<26) {$ventNNO3++ ;}
elseif ($gust[$i]>25 and $gust[$i]<36) {$ventNNO4++ ;}
elseif ($gust[$i]>35 and $gust[$i]<51) {$ventNNO5++ ;}
elseif ($gust[$i]>50 and $gust[$i]<81) {$ventNNO6++ ;}
elseif ($gust[$i]>80) {$ventNNO7++ ;}
;}
$i++;
};
// On calcule la répartition en pourcentage pour chaque directions et chaque forces avec 2 chiffres après la virgule
$gustN1 = round($ventN1/$nombre*100,2) ;
$gustN2 = round($ventN2/$nombre*100,2) ;
$gustN3 = round($ventN3/$nombre*100,2) ;
$gustN4 = round($ventN4/$nombre*100,2) ;
$gustN5 = round($ventN5/$nombre*100,2) ;
$gustN6 = round($ventN6/$nombre*100,2) ;
$gustN7 = round($ventN7/$nombre*100,2) ;
$gustNNE1 = round($ventNNE1/$nombre*100,2) ;
$gustNNE2 = round($ventNNE2/$nombre*100,2);
$gustNNE3 = round($ventNNE3/$nombre*100,2);
$gustNNE4 = round($ventNNE4/$nombre*100,2);
$gustNNE5 = round($ventNNE5/$nombre*100,2);
$gustNNE6 = round($ventNNE6/$nombre*100,2);
$gustNNE7 = round($ventNNE7/$nombre*100,2);
$gustNE1 = round($ventNE1/$nombre*100,2) ;
$gustNE2 = round($ventNE2/$nombre*100,2);
$gustNE3 = round($ventNE3/$nombre*100,2);
$gustNE4 = round($ventNE4/$nombre*100,2);
$gustNE5 = round($ventNE5/$nombre*100,2);
$gustNE6 = round($ventNE6/$nombre*100,2);
$gustNE7 = round($ventNE7/$nombre*100,2);
$gustENE1 = round($ventENE1/$nombre*100,2) ;
$gustENE2 = round($ventENE2/$nombre*100,2);
$gustENE3 = round($ventENE3/$nombre*100,2);
$gustENE4 = round($ventENE4/$nombre*100,2);
$gustENE5 = round($ventENE5/$nombre*100,2);
$gustENE6 = round($ventENE6/$nombre*100,2);
$gustENE7 = round($ventENE7/$nombre*100,2);
$gustE1 = round($ventE1/$nombre*100,2) ;
$gustE2 = round($ventE2/$nombre*100,2);
$gustE3 = round($ventE3/$nombre*100,2);
$gustE4 = round($ventE4/$nombre*100,2);
$gustE5 = round($ventE5/$nombre*100,2);
$gustE6 = round($ventE6/$nombre*100,2);
$gustE7 = round($ventE7/$nombre*100,2);
$gustESE1 = round($ventESE1/$nombre*100,2) ;
$gustESE2 = round($ventESE2/$nombre*100,2);
$gustESE3 = round($ventESE3/$nombre*100,2);
$gustESE4 = round($ventESE4/$nombre*100,2);
$gustESE5 = round($ventESE5/$nombre*100,2);
$gustESE6 = round($ventESE6/$nombre*100,2);
$gustESE7 = round($ventESE7/$nombre*100,2);
$gustSE1 = round($ventSE1/$nombre*100,2) ;
$gustSE2 = round($ventSE2/$nombre*100,2);
$gustSE3 = round($ventSE3/$nombre*100,2);
$gustSE4 = round($ventSE4/$nombre*100,2);
$gustSE5 = round($ventSE5/$nombre*100,2);
$gustSE6 = round($ventSE6/$nombre*100,2);
$gustSE7 = round($ventSE7/$nombre*100,2);
$gustSSE1 = round($ventSSE1/$nombre*100,2) ;
$gustSSE2 = round($ventSSE2/$nombre*100,2);
$gustSSE3 = round($ventSSE3/$nombre*100,2);
$gustSSE4 = round($ventSSE4/$nombre*100,2);
$gustSSE5 = round($ventSSE5/$nombre*100,2);
$gustSSE6 = round($ventSSE6/$nombre*100,2);
$gustSSE7 = round($ventSSE7/$nombre*100,2);
$gustS1 = round($ventS1/$nombre*100,2) ;
$gustS2 = round($ventS2/$nombre*100,2);
$gustS3 = round($ventS3/$nombre*100,2);
$gustS4 = round($ventS4/$nombre*100,2);
$gustS5 = round($ventS5/$nombre*100,2);
$gustS6 = round($ventS6/$nombre*100,2);
$gustS7 = round($ventS7/$nombre*100,2);
$gustSSO1 = round($ventSSO1/$nombre*100,2) ;
$gustSSO2 = round($ventSSO2/$nombre*100,2);
$gustSSO3 = round($ventSSO3/$nombre*100,2);
$gustSSO4 = round($ventSSO4/$nombre*100,2);
$gustSSO5 = round($ventSSO5/$nombre*100,2);
$gustSSO6 = round($ventSSO6/$nombre*100,2);
$gustSSO7 = round($ventSSO7/$nombre*100,2);
$gustSO1 = round($ventSO1/$nombre*100,2) ;
$gustSO2 = round($ventSO2/$nombre*100,2);
$gustSO3 = round($ventSO3/$nombre*100,2);
$gustSO4 = round($ventSO4/$nombre*100,2);
$gustSO5 = round($ventSO5/$nombre*100,2);
$gustSO6 = round($ventSO6/$nombre*100,2);
$gustSO7 = round($ventSO7/$nombre*100,2);
$gustOSO1 = round($ventOSO1/$nombre*100,2) ;
$gustOSO2 = round($ventOSO2/$nombre*100,2);
$gustOSO3 = round($ventOSO3/$nombre*100,2);
$gustOSO4 = round($ventOSO4/$nombre*100,2);
$gustOSO5 = round($ventOSO5/$nombre*100,2);
$gustOSO6 = round($ventOSO6/$nombre*100,2);
$gustOSO7 = round($ventOSO7/$nombre*100,2);
$gustO1 = round($ventO1/$nombre*100,2) ;
$gustO2 = round($ventO2/$nombre*100,2);
$gustO3 = round($ventO3/$nombre*100,2);
$gustO4 = round($ventO4/$nombre*100,2);
$gustO5 = round($ventO5/$nombre*100,2);
$gustO6 = round($ventO6/$nombre*100,2);
$gustO7 = round($ventO7/$nombre*100,2);
$gustONO1 = round($ventONO1/$nombre*100,2) ;
$gustONO2 = round($ventONO2/$nombre*100,2);
$gustONO3 = round($ventONO3/$nombre*100,2);
$gustONO4 = round($ventONO4/$nombre*100,2);
$gustONO5 = round($ventONO5/$nombre*100,2);
$gustONO6 = round($ventONO6/$nombre*100,2);
$gustONO7 = round($ventONO7/$nombre*100,2);
$gustNO1 = round($ventNO1/$nombre*100,2) ;
$gustNO2 = round($ventNO2/$nombre*100,2);
$gustNO3 = round($ventNO3/$nombre*100,2);
$gustNO4 = round($ventNO4/$nombre*100,2);
$gustNO5 = round($ventNO5/$nombre*100,2);
$gustNO6 = round($ventNO6/$nombre*100,2);
$gustNO7 = round($ventNO7/$nombre*100,2);
$gustNNO1 = round($ventNNO1/$nombre*100,2) ;
$gustNNO2 = round($ventNNO2/$nombre*100,2);
$gustNNO3 = round($ventNNO3/$nombre*100,2);
$gustNNO4 = round($ventNNO4/$nombre*100,2);
$gustNNO5 = round($ventNNO5/$nombre*100,2);
$gustNNO6 = round($ventNNO6/$nombre*100,2);
$gustNNO7 = round($ventNNO7/$nombre*100,2);
Code : Tout sélectionner
// On initialise les directions
$provN=0; $dirN=0;
$provNNE=0; $dirNNE=0;
$provNE=0; $dirNE=0;
$provENE=0; $dirENE=0;
$provE=0; $dirE=0;
$provESE=0; $dirESE=0;
$provSE=0; $dirSE=0;
$provSSE=0; $dirSSE=0;
$provS=0; $dirS=0;
$provSSO=0; $dirSSO=0;
$provSO=0; $dirSO=0;
$provOSO=0; $dirOSO=0;
$provO=0; $dirO=0;
$provONO=0; $dirONO=0;
$provNO=0; $dirNO=0;
$provNNO=0; $dirNNO=0;
// Pour la plage horaire déterminée, on compte le nombre total d'enregistrements avec vent non nul (wingust>0) et on ne selectionne que les enregistrements avec vent non nul (traitement des données plus rapide).
$sql = "Select COUNT(*) as Total from data where tstamp > '$start' and tstamp <= '$stop' and windgust > 0";
$query = mysqli_query($conn,$sql);
$list=mysqli_fetch_array($query);
$nombre=$list['Total'];
$i=0;
$sql = "SELECT winddir FROM data where tstamp >= '$start' and tstamp <= '$stop' and windgust > 0";
$query = mysqli_query($conn,$sql);
// On compte le nombre d'enregistrements pour chaque directions
while ($list = mysqli_fetch_assoc($query)) {
$dirvent[$i]=$list['winddir']*1;
if (($dirvent[$i]==0)||($dirvent[$i]==360)) {$provN++ ;}
elseif (($dirvent[$i]==22) || ($dirvent[$i]==22.5)) {$provNNE++ ;}
elseif ($dirvent[$i]==45) {$provNE++ ;}
elseif (($dirvent[$i]==67.5) || ($dirvent[$i]==68)) {$provENE++ ;}
elseif ($dirvent[$i]==90) {$provE++ ;}
elseif (($dirvent[$i]==112) || ($dirvent[$i]==112.5)) {$provESE++ ;}
elseif ($dirvent[$i]==135) {$provSE++ ;}
elseif (($dirvent[$i]==157.5) || ($dirvent[$i]==158)) {$provSSE++ ;}
elseif ($dirvent[$i]==180) {$provS++ ;}
elseif (($dirvent[$i]==202) || ($dirvent[$i]==202.5)) {$provSSO++ ;}
elseif ($dirvent[$i]==225) {$provSO++ ;}
elseif (($dirvent[$i]==247.5) || ($dirvent[$i]==248)) {$provOSO++ ;}
elseif ($dirvent[$i]==270) {$provO++ ;}
elseif (($dirvent[$i]==292) || ($dirvent[$i]==292.5)) {$provONO++ ;}
elseif ($dirvent[$i]==315) {$provNO++ ;}
elseif (($dirvent[$i]==337.5) || ($dirvent[$i]==338)) {$provNNO++ ;}
$i++;
};
// On calcule la répartition en pourcentage pour chaque directions avec 2 chiffres après la virgule.
$dirN=round($provN/$nombre*100,2);
$dirNNE=round($provNNE/$nombre*100,2);
$dirNE=round($provNE/$nombre*100,2);
$dirENE=round($provENE/$nombre*100,2);
$dirE=round($provE/$nombre*100,2);
$dirESE=round($provESE/$nombre*100,2);
$dirSE=round($provSE/$nombre*100,2);
$dirSSE=round($provSSE/$nombre*100,2);
$dirS=round($provS/$nombre*100,2);
$dirSSO=round($provSSO/$nombre*100,2);
$dirSO=round($provSO/$nombre*100,2);
$dirOSO=round($provOSO/$nombre*100,2);
$dirO=round($provO/$nombre*100,2);
$dirONO=round($provONO/$nombre*100,2);
$dirNO=round($provNO/$nombre*100,2);
$dirNNO=round($provNNO/$nombre*100,2);