Author Topic: Temperature and appreciation  (Read 2653 times)

0 Members and 1 Guest are viewing this topic.

Offline druss67

  • Member
  • *
  • Posts: 12
Temperature and appreciation
« on: May 29, 2012, 03:10:33 PM »
Hi,

I have noticed that temperature and appreciation are not aligned.
For example an external temperature 22,3C (54,3F) is tagged as cold.

Have you the same ?

Best regards,
Druss

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Temperature and appreciation
« Reply #1 on: May 29, 2012, 03:58:34 PM »
It would help to have the URL of your weather website .. hard to diagnose an issue from just a screen-capture image :(
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline druss67

  • Member
  • *
  • Posts: 12
Re: Temperature and appreciation
« Reply #2 on: May 30, 2012, 06:18:49 AM »
Hi,

I beg your pardon, herewith link to my site http://druss.alwaysdata.net/meteo/wxindex.php

Best regards,
Rgis

Offline DanS

  • Chiang Mai weather
  • Forecaster
  • *****
  • Posts: 5434
    • ThaiWx
Re: Temperature and appreciation
« Reply #3 on: May 30, 2012, 06:34:09 AM »

For example an external temperature 22,3C (54,3F) is tagged as cold.


To me '54,3F' is cold. I believe you meant 72.1F.  :-)

Offline druss67

  • Member
  • *
  • Posts: 12
Re: Temperature and appreciation
« Reply #4 on: May 31, 2012, 06:24:24 AM »
Yes, you are right, 22,3C = 72,1F, and for me this is not cold...

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Temperature and appreciation
« Reply #5 on: June 01, 2012, 01:58:08 PM »
Looks like it's working correctly now.  I think that you just needed to run Meteohub for 24 hours so a yesterday.php file with your metric units could be captured.  The original display was showing the yesterday.php information from the template distribution (which had Imperial units and values from my station).

I've added your site to the list of template sites :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline druss67

  • Member
  • *
  • Posts: 12
Re: Temperature and appreciation
« Reply #6 on: June 02, 2012, 04:41:17 AM »
Hi SaratogaWX,

thanks you for adding my sites to the templates  :lol:

But, appreciation is linked to the actual temperature, I presume.
So, why for a temperature of 22.6C (72.6F) appreciation is cold (screen2).

For example if you look at this site, http://www.weerstation-wilsele.be/weather/index.php?p=10&lang=en
temperature 22.3C (72.1F) is tagged comfortable... (screen3)

And I am sure that's some month ago it was good...

Sorry if I have missed something but I can't understand why...    

Druss
« Last Edit: June 02, 2012, 04:49:47 AM by druss67 »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Temperature and appreciation
« Reply #7 on: June 02, 2012, 03:19:23 PM »
If you look at http://www.weerstation-wilsele.be/weather/index.php?p=84 for status, you'll see
Quote
Current status of the weather systems used in the operation of this website

This station uses Meteohub (4.9i b6662) software for weather conditions reporting
This software runs on a ALIX.1D (500 MHz) computer.
Component    Status    Age h:m:s   Latest update time as of 02-06-2012 21:15
Meteohub realtime    NOT Current    143:35:18    > 0:01:30 27-05-2012 21:40
Meteohub weatherfiles    NOT Current    143:35:18    > 0:02:30 27-05-2012 21:40
Meteohub graphs    NOT Current    143:45:18    > 1:00:30 27-05-2012 21:30
Meteohub weather data    NOT Current    143:36:55    > 0:02:30 27-05-2012 21:39
which indicates that the FTP upload of your files is not currently working, so you're really displaying data from  27-05-2012  21:39.  That is likely the cause of the incorrect displays.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline druss67

  • Member
  • *
  • Posts: 12
Re: Temperature and appreciation
« Reply #8 on: June 02, 2012, 05:07:12 PM »
Hi Ken,

previous site was an example, there is no FTP issue on my site, look at screen4 in attachment.

My problem is sensation is always tagged as "cold" even when the temperature is hot.

Sorry if I put you in a bad way...  :???: , my English is not very good.

How sensation is "calculate" it came from meteohub or from the script...

Best regards,
Druss

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9399
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Temperature and appreciation
« Reply #9 on: June 02, 2012, 06:02:55 PM »
No apologies for your English are necessary .. you are quite understandable :)

Sorry that I'd assumed the example site in the post above was a link to your site at http://druss.alwaysdata.net/meteo/wxindex.php

The conditions color word is set by:

1) The PHP ajax-dashboard.php Version 1.21 - 01-Oct-2011 uses
Code: [Select]
<span class="ajax" id="ajaxheatcolorword">
                    <?php  langtrans($heatcolourword); ?></span>
to display the color word.

2) the PHP value for $heatcolourword comes from the MH-defs.php (for the Meteohub plugin) which has
Code: [Select]
list($feelslike,$heatcolourword) = MH_setFeelslike ($temperature,$windch,$heati,$uomtemp);
to set both the feelslike and heatcolorword based on the temperature, windchill, heatindex and units-for temp.

3) the MH-defs.php file has the following mappings for those items to your Meteohub tags data
Code: [Select]
$temperature = $WX['actual_th0_temp_c'];
$windch = $WX['actual_wind0_chill_c'];
$heati = $WX['actual_th0_heatindex_c'];
if(isset($WX['actual_system_temp_unit'])) { $uomtemp = $WX['actual_system_temp_unit']; }

4) your MHtags.php?sce=dump shows the following values
Code: [Select]
$WX['actual_th0_temp_c'] = '16.5';
$WX['actual_wind0_chill_c'] = '0.0';
$WX['actual_th0_heatindex_c'] = '16.5';
$WX['actual_system_temp_unit'] = 'c';

5) the MH_setFeelslike() function (which is in MH-defs.php) uses
Code: [Select]
#-------------------------------------------------------------------------------------
# MH support function - MH_setFeelslike
#-------------------------------------------------------------------------------------


function MH_setFeelslike ($temp,$windchill,$heatindex,$tempUOM) {
global $Debug;
// establish the feelslike temperature and return a word describing how it feels

$HeatWords = array(
 'Unknown', 'Extreme Heat Danger', 'Heat Danger', 'Extreme Heat Caution', 'Extremely Hot', 'Uncomfortably Hot',
 'Hot', 'Warm', 'Comfortable', 'Cool', 'Cold', 'Uncomfortably Cold', 'Very Cold', 'Extreme Cold' );

// first convert all temperatures to Centigrade if need be
  $TC = $temp;
  $WC = $windchill;
  $HC = $heatindex;
  
  if(strpos($TC,',') !== false) {
$TC = preg_replace('|,|','.',$temp);
$WC = preg_replace('|,|','.',$windchill);
$HC = preg_replace('|,|','.',$heatindex);
  }
  
  if (preg_match('|F|i',$tempUOM))  { // convert F to C if need be
$TC = sprintf("%01.1f",round(($TC-32.0) / 1.8,1));
$WC = sprintf("%01.1f",round(($WC-32.0) / 1.8,1));
$HC = sprintf("%01.1f",round(($HC-32.0) / 1.8,1));
  }
 
 // Feelslike
 
  if ($TC <= 16.0 ) {
$feelslike = $WC; //use WindChill
  } elseif ($TC >=27.0) {
$feelslike = $HC; //use HeatIndex
  } else {
$feelslike = $TC;   // use temperature
  }

  if (preg_match('|F|i',$tempUOM))  { // convert C back to F if need be
$feelslike = (1.8 * $feelslike) + 32.0;
  }
  $feelslike = round($feelslike,0);

// determine the 'heat color word' to use  
 $hcWord = $HeatWords[0];
 $hcFound = false;
 if ($TC > 32 and $HC > 29) {
if ($HC > 54 and ! $hcFound) { $hcWord = $HeatWords[1]; $hcFound = true;}
if ($HC > 45 and ! $hcFound) { $hcWord = $HeatWords[2]; $hcFound = true; }
if ($HC > 39 and ! $hcFound) { $hcWord = $HeatWords[4]; $hcFound = true; }
if ($HC > 29 and ! $hcFound) { $hcWord = $HeatWords[6]; $hcFound = true; }
 } elseif ($WC < 16 ) {
if ($WC < -18 and ! $hcFound) { $hcWord = $HeatWords[13]; $hcFound = true; }
if ($WC < -9 and ! $hcFound)  { $hcWord = $HeatWords[12]; $hcFound = true; }

if ($WC < -1 and ! $hcFound)  { $hcWord = $HeatWords[11]; $hcFound = true; }
if ($WC < 8 and ! $hcFound)   { $hcWord = $HeatWords[10]; $hcFound = true; }
if ($WC < 16 and ! $hcFound)  { $hcWord = $HeatWords[9]; $hcFound = true; }
 } elseif ($WC >= 16 and $TC <= 32) {
if ($TC <= 26 and ! $hcFound) { $hcWord = $HeatWords[8]; $hcFound = true; }
if ($TC <= 32 and ! $hcFound) { $hcWord = $HeatWords[7]; $hcFound = true; }
 }

 if(isset($_REQUEST['debug'])) {
  echo "<!-- MH_setFeelslike input T,WC,HI,U='$temp,$windchill,$heatindex,$tempUOM' cnvt T,WC,HI='$TC,$WC,$HC' feelslike=$feelslike hcWord=$hcWord -->\n";
 }

 return(array($feelslike,$hcWord));

} // end of MH_setFeelslike
to generate both the feelslike and colorword.

6) since your station's windchill is '0.0', that seems to determine why the word 'cold' (froid in French) is displaying.

7) a similar calculation is done by the AJAX routine ajaxMHwx.js on the temperature, wind-chill, heatindex values from the Meteohub clientraw.txt file.

So... the reading is likely caused by Meteohub (4.9i b1061 - SheevaPlug) not calculating the wind-chill in actual_wind0_chill_c correctly.
My older Meteohub (4.9g b1046 - SheevaPlug) is not showing this issue, so I'd suggest you report the problem to Boris on the Meteohub forum as a bug.

Hope this helps...

Best regards,
Ken


« Last Edit: June 02, 2012, 06:05:02 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline druss67

  • Member
  • *
  • Posts: 12
Re: Temperature and appreciation
« Reply #10 on: June 04, 2012, 06:45:28 AM »
Hi Ken,

Many thanks for this clear explanation.

I try to forward this issue to the meteohub support.

Best regards,
Rgis

Offline big2000

  • Member
  • *
  • Posts: 8
    • meteotaranto.org
Re: Temperature and appreciation
« Reply #11 on: July 10, 2024, 08:31:08 AM »
Hi Ken and hello to everyone!

Bringing back this old topic 'cause i'm having basically the same problem.

When opening the index page (i'm using Scott's dashboard) i can see for a moment what WD is really "outputting". Later it just translate/changes to another "feels like" label.

I managed to take 2 screenshot: one before and one after.
(btw, right now it should say "extrame danger" that should be "estrema cautela" but it show instead "caldo pericoloso" which is "Heat Danger")

Any idea why the lables aren't working properly?

https://www.meteotaranto.org/

Silvio.