Forum GraphWeather

Forum d'aide GraphWeather
Nous sommes actuellement le Sam Avr 27, 2024 2:52 pm

Le fuseau horaire est UTC+1 heure




Publier un nouveau sujet Répondre au sujet  [ 24 message(s) ]  Aller vers la page Précédent  1, 2
Auteur Message
 Sujet du message:
MessagePublié: Lun Déc 17, 2007 11:15 am 
ok, it works now, but still the radargraph either plots a circle or nothing, depending on which data i select to display.
any hints on this one?


Haut
  
Répondre en citant  
 Sujet du message:
MessagePublié: Lun Déc 17, 2007 3:17 pm 
Hors-ligne
Membre
Avatar de l’utilisateur

Inscription : Mar Août 22, 2006 8:38 am
Message(s) : 3145
Localisation : 34410 Sérignan - Languedoc
Hi Grug
Is Wind direction in degrees ?

_________________
Jean

Station : VP2 Pro Console Vue + anémomètre à Ultra-sons
Logiciels : Cumulus 1.9.4 + Cumulus2SQL
Serveur local : Apache + MySQL +PHP
PC : W10
Support Audio : FR

http://meteoserignan.ddns.net
Image
"Aide-toi d'abord toi-même et les autres t'aideront ... peut-être"


Haut
 Profil  
Répondre en citant  
 Sujet du message:
MessagePublié: Lun Déc 17, 2007 4:30 pm 
yeah, in my db the winddata looks like "22.5" or "67.5" or "337.5"


Haut
  
Répondre en citant  
 Sujet du message:
MessagePublié: Lun Déc 17, 2007 4:45 pm 
forgot to say, the wind direction in the db seems to be rounded in 16 steps with 22.5 degrees each (0,22.5,45,67.5,.....337,5)


Haut
  
Répondre en citant  
 Sujet du message:
MessagePublié: Mar Déc 18, 2007 8:00 am 
Hors-ligne
Membre
Avatar de l’utilisateur

Inscription : Mar Août 22, 2006 8:38 am
Message(s) : 3145
Localisation : 34410 Sérignan - Languedoc
I don't see any reason why it would not work. It is normal to have 16 steps of 22.5° because HeavyWeather gives directions from 0 to 16 and it's converted in the db loading to make it compatible with GraphWeather. In fact I should have never asked this question because I knew the answer. Excuse me Grug.
I think that now it's Antoine competencies which are needed ... Antoine your turn !

_________________
Jean

Station : VP2 Pro Console Vue + anémomètre à Ultra-sons
Logiciels : Cumulus 1.9.4 + Cumulus2SQL
Serveur local : Apache + MySQL +PHP
PC : W10
Support Audio : FR

http://meteoserignan.ddns.net
Image
"Aide-toi d'abord toi-même et les autres t'aideront ... peut-être"


Haut
 Profil  
Répondre en citant  
 Sujet du message:
MessagePublié: Mar Déc 18, 2007 12:31 pm 
Hors-ligne
Site Admin
Avatar de l’utilisateur

Inscription : Lun Mars 20, 2006 11:16 am
Message(s) : 3356
Localisation : Montréal
Could you make some screenshots of graph and database field (with values) ?


Haut
 Profil  
Répondre en citant  
 Sujet du message:
MessagePublié: Mar Déc 18, 2007 7:25 pm 
Hors-ligne
Nouveau membre

Inscription : Mar Déc 18, 2007 7:18 pm
Message(s) : 2
ok, here are some screenshots:
Image
Image
(copy image address for larger view)
And some code(which i didn't change):
Code :
$sql="SELECT `";
$sql.=$MYSQL_FIELD['absolute_pressure']."`,`";
$sql.=$MYSQL_FIELD['outdoor_humidity']."`,`";
$sql.=$MYSQL_FIELD['outdoor_temperature']."`,`";
$sql.=$MYSQL_FIELD['dew_point']."`,`";
$sql.=$MYSQL_FIELD['wind_chill']."`,`";
$sql.=$MYSQL_FIELD['wind_direction']."`,`";
$sql.=$MYSQL_FIELD['wind_speed']."`,`";
$sql.=$MYSQL_FIELD['total_rainfall']."`,`";
$sql.=$MYSQL_FIELD['timestamp']."`";
$sql.=" FROM ".$MYSQL_TABLE." WHERE ".$MYSQL_FIELD['timestamp']."<='".$StopDate."' AND ".$MYSQL_FIELD['timestamp'].">='".$StartDate."'";
$query=mysql_query($sql) or die ("MYSQL error : ".mysql_error());
mysql_close();
for ($i=0;$i<16;$i++) $count[$i]=0;
$i=0;
while ($list=mysql_fetch_array($query))
{   
   $y1data[$i]=$list[0];
   $y2data[$i]=$list[1];
   $y3data[$i]=$list[2];
   $y4data[$i]=$list[3];
   $y5data[$i]=$list[4];
   $count[round($list[5])]=$count[round($list[5])]+1;
   $y6data[$i]=$list[6];
   $y7data[$i]=$list[7];
   switch($MYSQL_TIMESTAMP)
   {
      case 0 :
         $timestamp[$i]=$list[8];
         break;
      default: case 1:
         sscanf($list[8],"%4d%2d%2d%2d%2d%2d",$a_year,$a_month,$a_day,$a_hours,$a_minutes,$a_seconds);
         $timestamp[$i]=intval(mktime($a_hours,$a_minutes,$a_seconds,$a_month,$a_day,$a_year,-1));
         break;
   }
   $i++;
}

$y1max=max($y1data);
$y2max=max($y2data);
$y3max=max($y3data);
$y4max=max($y4data);
$y5max=max($y5data);
$y6max=max($y6data);
$YMAX=max($y3max,$y4max,$y5max);

$y1min=min($y1data);
$y2min=min($y2data);
$y3min=min($y3data);
$y4min=min($y4data);
$y5min=min($y5data);
$YMIN=min($y3min,$y4min,$y5min);

$YMAX=round($YMAX+($YMAX-$YMIN)*0.1);
$YMIN=round($YMIN-($YMAX-$YMIN)*0.1);

$ticks_number=($HEIGHT1-$MARGIN_TOP1-$MARGIN_BOTTOM1)/20; //inter tick 40px
$YTICK_INTERVAL=round(($YMAX-$YMIN)/$ticks_number);

for($i=0;$i<count($y2data);$i++)
{
   $y2data[$i]=$y2data[$i]*($YMAX-$YMIN)/100+$YMIN;
}


$total_rainfall=$y7data[count($y7data)-1]-$y7data[0];
for($i=0;$i<count($y7data)-1;$i++)
{
   $y7data[$i]=$y7data[$i+1]-$y7data[$i];
}
$y7data[count($y7data)-1]=$y7data[count($y7data)-2]; //last value


$STATS.="sql=".($timer->Pop()/1000)."s ";

.
.
.
.
.
// ----------------------------------------------------------------------
// - GRAPH3 : PREVAILING WIND
// ----------------------------------------------------------------------

// Reverse values
$new_count[0]=$count[0];
for ($i=1;$i<16;$i++)
{
   $new_count[$i]=$count[16-$i];
}


$graph3 = new RadarGraph($WIDTH3,$HEIGHT3,"auto");
$graph3->SetCenter(0.17,0.5);

$graph3->SetColor($BACKGROUND_COLOR);
$graph3->SetMargin($MARGIN_LEFT3,$MARGIN_RIGHT3,$MARGIN_TOP3,$MARGIN_BOTTOM3);
$graph3->title->SetFont(FF_FONT1,FS_NORMAL,11);
$graph3->title->Set("vorherrschende Windrichtung");
$graph3->title->SetAlign("left");
$graph3->axis->SetFont(FF_FONT1,FS_NORMAL,8);
$graph3->axis->title->SetFont(FF_FONT1,FS_NORMAL,8);
$graph3->SetFrame(true,'black',0);
$graph3->SetTitles(array("N","NN0","N0","0N0","0","0S0","S0","SS0","S","SSE","SE","ESE","E","ENE","NE","NNE","N"));
$graph3->grid->Show ();
$graph3->grid-> SetLineStyle( "solid");

$polar = new RadarPlot($new_count);
$polar->SetFillColor('blue@0.8');
$polar->SetColor('blue@0.6');
$graph3->Add($polar);
$graph3->AddText($minmax);
$graph3->AddText($db_infos);
$graph3->AddText($legend);

$handle3 = $graph3->Stroke(_IMG_HANDLER);

$STATS.="graph=".($timer->Pop()/1000)."s ";

Hope this helps;-)


Haut
 Profil  
Répondre en citant  
 Sujet du message:
MessagePublié: Mar Déc 18, 2007 11:49 pm 
Hors-ligne
Site Admin
Avatar de l’utilisateur

Inscription : Lun Mars 20, 2006 11:16 am
Message(s) : 3356
Localisation : Montréal
Hi,

This line is false :
$count[round($list[5])]=$count[round($list[5])]+1;
since we have a decoded wind direction.

You should try this :
$count[$list[5]/22.5]=$count[$list[5]/22.5]+1;

or this (exactly the same result but optimized) :
$count[$list[5]/22.5]++;

Antoine.


Haut
 Profil  
Répondre en citant  
 Sujet du message:
MessagePublié: Mer Déc 19, 2007 10:36 am 
Hors-ligne
Nouveau membre

Inscription : Mar Déc 18, 2007 7:18 pm
Message(s) : 2
Hi Antoine, it works. Thank you so much.
Great work, your script!!!


Haut
 Profil  
Répondre en citant  
Afficher les messages publiés depuis :  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 24 message(s) ]  Aller vers la page Précédent  1, 2

Le fuseau horaire est UTC+1 heure


Qui est en ligne ?

Utilisateur(s) parcourant ce forum : Aucun utilisateur inscrit et 32 invité(s)


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Recherche de:
Aller vers :  
POWERED_BY
Traduction et support en françaisHébergement de site