I think you misunderstood what Mark recommended and how the feelslike determination works. Your current code in ajaxCUwx.js has
Code: Select all
// FeelsLike
temp = cTempToC(realtime[54]); // note.. temp in C
var HC = 0;
var HCraw = 0;
switch (useFeelslike) {
case 0:
HCraw = realtime[41]; //use HeatIndex
break;
case 1:
HCraw = realtime[42]; //use Humidex
break;
case 2:
HCraw = realtime[54]; //use Apparent Temperature
break;
default:
HCraw = realtime[41]; //use HeatIndex (default)
break;
}
var HC = cTempToC(HCraw);
if (temp <= 16.0 ) {
feelslike = cTempToC(realtime[24]); //use WindChill
} else if (temp >=27.0) {
feelslike = HC; //use HeatIndex/Humidex/ApparentTemp
} else {
feelslike = temp; // use temperature
}
var feelslike = Math.round(convertTempC(feelslike));
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
The first line
Code: Select all
temp = cTempToC(realtime[54]); // note.. temp in C
should be
Code: Select all
temp = cTempToC(realtime[2]); // note.. temp in C
to use the actual temperature now as the comparison point.
It is later in the code set
Code: Select all
var HC = cTempToC(HCraw);
if (temp <= 16.0 ) {
feelslike = cTempToC(realtime[24]); //use WindChill
} else if (temp >=27.0) {
feelslike = HC; //use HeatIndex/Humidex/ApparentTemp
} else {
feelslike = temp; // use temperature
}
where the feelslike temperature is set from either the apparenttemp (if current>=27C) or windchill (if current <=16C) or the actual temperature if in between those values. Your quest to use apparenttemp for ALL the feelslike is curious for two reasons:
1) most met offices use WindChill or equivalent for indication of 'how it feels' when the temperatures are below 16C, so that is what the script uses too.
2) does apparent temperature includes any 'wind chill' adjustments or is like a 'heat index' at the high end (above 27C)?
The Cumulus doc for it states:
Apparent temperature is the general term for the perceived outdoor temperature, caused by the combined effects of air temperature, relative humidity and wind speed.
Specifically, in Cumulus, a formula from the BOM is used:
http://www.bom.gov.au/info/thermal_stre ... roximation
and the BOM.au site does indicate that Apparent Temperature in their calculations does encompass wind chill effects.
So.. to use it exclusively as the feelslike temperature, you need to change
Code: Select all
var feelslike = Math.round(convertTempC(feelslike));
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
to
Code: Select all
var feelslike = Math.round(convertTemp(realtime[54]));
set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
and feelslike will always use apparent temperature.
When you're making changes to code, it's always best to see ALL the calculations that lead up to the final result.