Re: Now available: AJAX/PHP multilingual website templates
Posted: Thu 15 Sep 2011 7:05 am
Ken, You are genious! With latest cu-defs and tags update You have resolved all issues with european dates dd.mm.yyyy (dot separator)!
Support forum for Cumulus weather station software
https://cumulus.hosiene.co.uk/
I discovered a small bug in how the Cumulus-plugin and the ajaxCUwx.js handle the 'feelslike' temperature.WoodburyMan wrote:Just wondering how the function to display "Feels Like" works. Earlier today when it was about 82.8F and some humidity, it was displaying a "Feels Like" value of 96F. However.. my records show today's Heat Index only going to 85.8F, and Apparent Temperature only going as high as 89.4F. What value was this displaying?
I looked around and saw in some files it uses Heat Index, Wind Chill and Apparent temperature somehow but I'm not do adapt in PHP to figure out what exactly it was doing, or how it could somehow come up with the 96F reading. Likewise is there a way I can eliminate Apparent Temperature from being used in "Feels Like" function? (I feel it always reports to high of a temperature and feel Heat Index is more accurate, at least for me personally and would like for it to either display Heat Index or Wind Chill only). While I'm at it to, is there a way for Feels Like to display tenths of a digit? (Ex. 89.4F instead of 84F)
Code: Select all
// FeelsLike
temp = cTempToC(realtime[2]); // note.. temp in C
if (temp <= 16.0 ) {
feelslike = cTempToC(realtime[24]); //use WindChill
} else if (temp >=27.0) {
feelslike = cTempToC(realtime[42]); //use Humidex
} else {
feelslike = temp; // use temperature
}
var feelslike = Math.round(convertTempC(feelslike));
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
// # mike challis added heatColorWord feature
var heatColorWord = heatColor(realtime[2],realtime[24],realtime[42]);
set_ajax_obs("ajaxheatcolorword",heatColorWord);
Code: Select all
// FeelsLike
temp = cTempToC(realtime[2]); // note.. temp in C
if (temp <= 16.0 ) {
feelslike = cTempToC(realtime[24]); //use WindChill
} else if (temp >=27.0) {
feelslike = cTempToC(realtime[41]); //use Heat Index
} else {
feelslike = temp; // use temperature
}
var feelslike = Math.round(convertTempC(feelslike));
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
// # mike challis added heatColorWord feature
var heatColorWord = heatColor(realtime[2],realtime[24],realtime[41]);
set_ajax_obs("ajaxheatcolorword",heatColorWord);
Code: Select all
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
Thanks for the kind words!vpokroglo wrote:Ken, You are genious! With latest cu-defs and tags update You have resolved all issues with european dates dd.mm.yyyy (dot separator)!
So are you saying that you have a function to specifically change Cumulus 'feels like', and if so, is it optional ?The apparent temperature reported by Cumulus uses the Australian BOM calculation for it's value. Even though the current CU-defs.php assigns the Cumulus apparent temperature to the $feelslike value, it is overridden by
Code:
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
further on in the code which overrides the $feelslike = $WX['apptemp'];
Thanks for the info Ken! I've modified my files accordingly. However I doubt I'll be having any more days where heat index is being used, yesterday was the last I bet. Doesn't look like we'll be breaking out of the 60F's in the next week at least.. Fall is here. Time for some good windchill values now!saratogaWX wrote:I discovered a small bug in how the Cumulus-plugin and the ajaxCUwx.js handle the 'feelslike' temperature.WoodburyMan wrote:Just wondering how the function to display "Feels Like" works. Earlier today when it was about 82.8F and some humidity, it was displaying a "Feels Like" value of 96F. However.. my records show today's Heat Index only going to 85.8F, and Apparent Temperature only going as high as 89.4F. What value was this displaying?
I looked around and saw in some files it uses Heat Index, Wind Chill and Apparent temperature somehow but I'm not do adapt in PHP to figure out what exactly it was doing, or how it could somehow come up with the 96F reading. Likewise is there a way I can eliminate Apparent Temperature from being used in "Feels Like" function? (I feel it always reports to high of a temperature and feel Heat Index is more accurate, at least for me personally and would like for it to either display Heat Index or Wind Chill only). While I'm at it to, is there a way for Feels Like to display tenths of a digit? (Ex. 89.4F instead of 84F)
The PHP in CU-defs.php set the $feelslike based on temperature, humidity and heat-index, and the ajaxCUwx.js sets it based on temperature, humidity and humidex, so the number is likely to change when the AJAX cuts in as the humidex is different from heat-index.
I'm making a change to ajaxCUwx.js to replacewithCode: Select all
// FeelsLike temp = cTempToC(realtime[2]); // note.. temp in C if (temp <= 16.0 ) { feelslike = cTempToC(realtime[24]); //use WindChill } else if (temp >=27.0) { feelslike = cTempToC(realtime[42]); //use Humidex } else { feelslike = temp; // use temperature } var feelslike = Math.round(convertTempC(feelslike)); set_ajax_obs("ajaxfeelslike",feelslike + uomTemp); // # mike challis added heatColorWord feature var heatColorWord = heatColor(realtime[2],realtime[24],realtime[42]); set_ajax_obs("ajaxheatcolorword",heatColorWord);so the AJAX update will match the PHP for source values used.Code: Select all
// FeelsLike temp = cTempToC(realtime[2]); // note.. temp in C if (temp <= 16.0 ) { feelslike = cTempToC(realtime[24]); //use WindChill } else if (temp >=27.0) { feelslike = cTempToC(realtime[41]); //use Heat Index } else { feelslike = temp; // use temperature } var feelslike = Math.round(convertTempC(feelslike)); set_ajax_obs("ajaxfeelslike",feelslike + uomTemp); // # mike challis added heatColorWord feature var heatColorWord = heatColor(realtime[2],realtime[24],realtime[41]); set_ajax_obs("ajaxheatcolorword",heatColorWord);
The apparent temperature reported by Cumulus uses the Australian BOM calculation for it's value. Even though the current CU-defs.php assigns the Cumulus apparent temperature to the $feelslike value, it is overridden byfurther on in the code which overrides the $feelslike = $WX['apptemp'];Code: Select all
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
Since the feelslike temperature is an estimate only, I don't recommend changing it to display a fractional digit and it's unlikely to make much difference in how it feels.. is 89.4 really perceived as that much more than 89 ?
BTW.. I know our Canadian friends prefer use of Humidex so I'll try working up a mod for their defs/AJAX that allows them to use Humidex instead of heat-index for their feelslike display.
Best regards,
Ken
Yes, there's a function in the CU-defs.php that sets both the $feelslike and $heatcolourword. The ajaxCUwx.js has a function for determining what 'heatcolourword' should be used based on the realtime.txt, and what 'feelslike' should be updated too.beteljuice wrote:So are you saying that you have a function to specifically change Cumulus 'feels like', and if so, is it optional ?The apparent temperature reported by Cumulus uses the Australian BOM calculation for it's value. Even though the current CU-defs.php assigns the Cumulus apparent temperature to the $feelslike value, it is overridden by
Code:
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
further on in the code which overrides the $feelslike = $WX['apptemp'];
Thinking further along, for all users of your code ....
User 'feels like' Options to be ..
- Station set
'Saratoga' reasoning
Austrailian BOM reasoning
I've also had the starmap (from Fourmilab Your Sky on my Sun/Moon/Sky page .. it's a neat application!WoodburyMan wrote: Thanks for the info Ken! I've modified my files accordingly. However I doubt I'll be having any more days where heat index is being used, yesterday was the last I bet. Doesn't look like we'll be breaking out of the 60F's in the next week at least.. Fall is here. Time for some good windchill values now!
Also a neat feature I added to one of my pages I thought I'd share. For those interested in watching the sky's at night I added a clear sky chart to my astronomy page. http://www.grudzien.us/wxastronomy.php. I had to expand the style sheets to a width of 875 vs 800 for it to fit right.
Also sent some beer money your way! Thanks again!
Neat! Added that to mine as well. Didn't know there were any web-based ones I could use in HTML.saratogaWX wrote:I've also had the starmap (from Fourmilab Your Sky on my Sun/Moon/Sky page .. it's a neat application!WoodburyMan wrote: Thanks for the info Ken! I've modified my files accordingly. However I doubt I'll be having any more days where heat index is being used, yesterday was the last I bet. Doesn't look like we'll be breaking out of the 60F's in the next week at least.. Fall is here. Time for some good windchill values now!
Also a neat feature I added to one of my pages I thought I'd share. For those interested in watching the sky's at night I added a clear sky chart to my astronomy page. http://www.grudzien.us/wxastronomy.php. I had to expand the style sheets to a width of 875 vs 800 for it to fit right.
Also sent some beer money your way! Thanks again!
Thanks for your kind donation!
Best regards,
Ken
Not sure how long it's been doing that, given it's now the 5th and they stated it would only be down the 1st it might be an issue. **HOWEVER** I noticed if I go to Weather.gov and type in my zip code to view the forecast on their site, I get the "Hazardous outlook" link there it works. http://forecast.weather.gov/showsigwx.p ... er+Outlook Notice the URL has forecast.weather.gov where as the other doesn't have the forecast subdomain. The same also goes for the frost advisory (Our first of the yearNational Weather Service
Wed Oct 05 2011 08:19:50 GMT-0400 (Eastern Daylight Time)
This site will be down for maintenance on Saturday 10/1.
Please use the following links for NWS forecasts and services.Forecasts:
http://forecast.weather.gov/zipcity.php
*Please type your zip code into the search box
Radar:
http://radar.weather.gov
Air Quality:
http://airquality.weather.gov
Aviation:
http://aviationweather.gov
River and Lake Forecasts and Observations:
http://water.weather.gov
Graphical Forecasts:
http://graphical.weather.gov
We apologize for any inconvenience that this might cause.
Code: Select all
"KOXC|Woodbury|http://forecast.weather.gov/MapClick.php?lat=41.55496712080976&lon=-73.22537899017334&site=aly&unit=0&lg=en&FcstType=texttextField2=-122.022&e=1&TextType=2",