Question about plaintext-parser.php script

I just started using WXSIM Forecast, and notice that in the plaintext-parser.php script that it’s suppose to override the condition icons under certain conditions like HOT! My question is that in my area we have been experiencing some very HOT! days lately, but my icons haven’t change to reflect it.

Attached is the portion of the script that’s suppose to do that.


partial_script.txt (3.33 KB)

That logic appears to be driven by the Heat Index value ($WXSIMheatidx), but I don’t see that your forecast http://paradiseweatherstation.org/WXSim/plaintext.txt includes that parameter.

In the plaintext-parser.php there is place adjust when this shows.

$showHotIconF = 90; // show Hot icon if Heat-Index >= value
$showHotIconC = 32; // show Hot icon if Humidex >= value

Tom

@weatherbee: Where does it get the heat index?

Niko,
lastret.txt & latest.csv files have heat index.
Tom

Tom

Maybe I’m missing it in the code but the only data file I see the script using is plaintext.txt :?

Niko

Niko,
You are right only plaintex.txt is used. I found

 // extract Heat Index value
 if (preg_match('|Heat index up to (\d+)\.|i',$WXSIMtext[$i],$mtemp) ) {
   $WXSIMheatidx[$i] = $mtemp[1];
 }

Later in the file:

// override icon with hot.jpg if high heat-index or humidex 
   if($WXSIMheatidx[$i] >= $showHotIconF or $WXSIMhumidex[$i] >= $showHotIconC) {
	   $WXSIMicon[$i] = 'hot.jpg';
	   $WXSIMcond[$i] .= "
\n<span style=\"color:red;\"><strong>" . PPget_lang('Hot!') . "</strong></span>";
   }
   
   if($WXSIMheatidx[$i] <> '') {
	   $WXSIMheatidx[$i] = "<span style=\"color: red;\">".PPget_lang('Heat').": $WXSIMheatidx[$i]$tempDegrees</span>\n";

My plaintext.txt for Thursday is
"Thursday: Partly to mostly cloudy in the morning, becoming mostly cloudy in the

afternoon. Moderate fog in the morning. A slight chance of rain in the morning,

then a chance of rain in the afternoon. Scattered thundershowers possible. Hot.

High 88. Heat index up to 95. UV index up to 8. Wind west-southwest around 5

mph, gusting to 17 mph, in the morning, becoming 8 mph, gusting to 19 mph, in

the afternoon. Chance of precipitation 40 percent. Precipitation mostly less

than a tenth of an inch."

Tom

Tom

RTur’s http://paradiseweatherstation.org/WXSim/plaintext.txt doesn’t include heat index, so it will never work. In general his file is very much simpler than yours.

"Thursday: Sunny. Hot. High 95. UV index up to 10. Wind south-southwest around 2
mph in the morning, becoming 7 mph, gusting to 16 mph, in the afternoon.

Thursday night: Clear. Low 64. Wind east-southeast around 4 mph."

Is that a wxsim setup issue?

Niko

As far as I remember, the heat-index must be checked in WRET, default it is not set according to the screenshot in the WXSIM manual.

Wim