Fog

I was just looking at a customer’s web site and his WXSIM forecast showed “fog” as the main description for a few days, and a very foggy-looking icon. I checked the plaintext data, though, and it said “partly cloudy”, with “patchy light fog” for Tuesday night and Wednesday. The patchy light fog would be forming late at night, would burn off soon after sunrise, and really should not be the dominant descriptor.

To authors of PHP scripts (first, thanks for all the great work!): would it be possible to allow the modifier’s “light” and/or “patchy light” to trigger a selection of the cloud condition (i.e. “partly cloudy”) instead of “fog”, to make a more realistic icon and main wording? Sometimes users think WXSIM is forecasting too much fog (and sometimes it is), when it just said “patchy light”, but the fog icon and wording is the main thing they see./

Thanks! :slight_smile:

Tom

Tom, as I am seeing exactly the same situation with my WXSIM produced forecasts.

I have modified the display of the short forecast ‘Fog’ with ‘Light Fog’ (removing the ‘patchy’ as it makes the forecast too long) and I have replaced the ‘fog’ icon with the ‘partly cloudy/scattered clouds’ icon.

The file to be modified is ‘plaintext-parser-data.txt’ - a new line of code/text needs to be added just below this line (line # 43):

cond|fog after midnight|sctfg|nbknfg|Fog late|

The new line:

cond|patchy light fog|sct|nsct|Light Fog|

Hi folks.

It’s my site that Tom is on about and it is a weird issue.
It seems that the plaintext-parser.php is not reading the line
cond|fog in the morning|sctfg|nbknfg|Fog a.m.|

and goes straight to

cond|fog|fg|nfg|Fog|

I tried your modification Ray but it still bypassed that line.

It’s not a huge issue but one that has me stumped. Any other suggestions appreciated :slight_smile:

You can see the forecast at http://www.sligoweather.com/wxforecast.php

I just visited your website and saw the issue you’re having. Interestingly, when I run your plaintext-parser.php, I see the correct Fog A.M. and Fog Late icons and verbiage, but with wxforecast.php, only the Fog icon is showing.

I also noticed that with plaintext-parser.php, all the icons show a chance of precip while none of them showed that with wxforecast.php. Perhaps the issue isn’t with plaintext-parser.php, but with something in wxforecast.php instead.

Steve

This is very odd.

When I run the script ‘native’ by http://www.sligoweather.com/plaintext-parser.php?debug=y it shows correctly with fog late/fog a.m. legends and icons. The view-source of the page shows

showing the correct selection was made.

When I do the same with http://www.sligoweather.com/wxforecast.php?debug=y (the page that includes the plaintext-parser.php for display), it shows only the fog icons and the view-source shows

note that after check ‘rain’ and skip-chance lines, the check ‘fog in the morning’ and check ‘fog after midnight’ checks are not present. It is as if there are two different plaintext-parser-data.txt files … one without the checks, and one with being loaded in the $Conditions array for checking.

Looking over the code for plaintext-parser.php and the rest of the template shows that get-metar-conditions-inc.php also uses a $Conditions array, and it appears that it is replacing the WXSIM set of conditions from plaintext-parser-data.txt and that is the cause of the issue.

A quick fix for you is to edit plaintext-parser.php and replace $Conditions (exact case match) with $WXSconditions for all occurrences then the interference will cease (I think).

Best regards,
Ken

The fix worked Ken. Thank you so much. That really was driving me silly.
One finally thing (hopefully), is there a way of pointing to the icons that show the percentage number on them as well?

Steve, thank you too for looking. Much appreciated.

You’re welcome… that was a strange one :slight_smile:

For the percentages to show, the FILE path to the icons must be correct. In Settings.php you have

$SITE['fcsticonsdir'] = '/forecast/images/'; // NOAA-style icons for NWS, WU, WXSIM forecast scripts

and that needs to be

$SITE['fcsticonsdir'] = './forecast/images/'; // NOAA-style icons for NWS, WU, WXSIM forecast scripts

for a FILE path (relative).

Best regards,
Ken

Brilliant, that worked. A damn ‘.’ causing me a headache :smiley:

Thanks again :slight_smile:

Forgot to mention… your ./cache/ directory is not fully functional on your site. Change that directory to permissions 766 (or 777 if you must) and use check-fetch-times.php?show=info to test it. Currently that says

Directories/files status for Base-World, CU-Plugin

Status of needed subdirectories
Settings.php Cache file directory in $SITE[‘cacheFileDir’]=‘./cache/’ exists, with permissions=drwxr-xr-x [0755]

Error: Unable to open/write to ./cache/test.txt file so so Cache directory is NOT fully functional.
Settings.php ajax-images file directory in $SITE[‘imagesDir’]=‘./ajax-images/’ exists; and appears to have contents.
Settings.php forecast images file directory in $SITE[‘fcsticonsdir’]=‘./forecast/images/’ exists; and appears to have .gif image contents.
Settings-weather.php $SITE[‘graphImageDir’]=‘./images/’ exists; and appears to have contents.
Settings-weather.php $SITE[‘NOAAdir’]=‘./Noaa/’ exists; and appears to have contents.

Having a fully functional cache directory will speed up the loading of pages on your site as it won’t have to go to the external website to fetch data each time your page (especially the home page) is loaded.

Best regards,
Ken

766 didn’t work so set to 777 and it works.
Thank you again Ken. Really appreciate your help.