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)
I discovered a small bug in how the Cumulus-plugin and the ajaxCUwx.js handle the 'feelslike' temperature.
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 replace
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);
with
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);
so the AJAX update will match the PHP for source values used.
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: Select all
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
further on in the code which overrides the $feelslike = $WX['apptemp'];
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