Page 6 of 7

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 23 Mar 2015 10:22 am
by beteljuice
Your RH never got higher than 96% so it looks like the cloudbase calculation is coming out a bit 'high'.
You could try a (Cumulus) calibration factor which would make the figure more realistic (and improve other calculations).

Else you need to alter the check values in the scripts fuzzy logic.

If I expand the code so you can follow it ....

Code: Select all

        if(decCom($cloudbasevalue) < ($cloudbaseunit == "m" ? 10 : 29) && $MinutesSinceLastRainTip > 15){ // less than 10m - a rough figure and NO rain

Code: Select all

// This bit
($cloudbaseunit == "m" ? 10 : 29)

// is the same as saying ...
if($cloudbaseunit == "m"){
   10; // check value in metres
} else {
    29; // check value in feet
} 
In your case I would suggest a 'feet' value of 240 > 250 :o

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 23 Mar 2015 8:53 pm
by BeaumarisWX
Thank's Beteljuice,

Appreciate you taking a look at it for me, I've not set any Calibration Factors at all since I started using my new Davis Pro 2 .

I will need to do some research in order to determine what to adjust and how.

I already understood the example you gave above the main one that confuses me is;
if(decCom($temp) < ($tempunitnodeg == "C" ? 4 : 39)){ // 4 deg C - True temp
$condOut .= $langCurrWeather["freeze"] . " ";
Fog scheduled for this evening, so will see what happens again this time.

Kind regards,

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Wed 25 Mar 2015 10:47 am
by beteljuice
@ HRVistaWeather - I've just realised I didn't answer your last question :oops:

I've also realised that Jenny didn't post the last 'bug-fix' I gave her ...

@ALL - Freezing Fog Bug Fix !!!
In curconditions.php scroll down to the fuzzy logic section and cut'n'paste the following replacement code snippet.

Code: Select all

// betejuice fuzzy logic
    $suppress = 0; // a flag which will influence skycond display
    $fog = 0;
// Automatic FOG detection - normally starts in the dark before you get up ;-)
    if($display['showFog']){
        if(decCom($cloudbasevalue) < ($cloudbaseunit == "m" ? 10 : 29) && $MinutesSinceLastRainTip > 15){ // less than 10m - a rough figure and NO rain
            if(decCom($temp)  < ($tempunitnodeg == "C" ? 4 : 39)){ // 4 deg C - True temp
                $auto = $hybrid = $langCurrWeather["freeze"] . " ";
            }
            $auto .= $langCurrWeather["fog"];
            $hybrid .= $langCurrWeather["fog"];
            $suppress = 1; // suppress skycond
            $fog = 1;
        }
    } // END fog check
@ HRVistaWeather - back to your last query ..
This bit ....

Code: Select all

            if(decCom($temp)  < ($tempunitnodeg == "C" ? 4 : 39)){ // 4 deg C - True temp
                $auto = $hybrid = $langCurrWeather["freeze"] . " ";
            }
Is similar to your original query

Code: Select all

($tempunitnodeg == "C" ? 4 : 39)

// is the same as saying

if($tempunitnodeg == "C"){
   4; // check temp deg C
} else {
   39; // check temp deg F
}
// rough figures ground temp will be lower than air - give prefix 'Freezing ' to fog advisory ;-)

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Wed 25 Mar 2015 9:01 pm
by BeaumarisWX
Thanks Beteljuice, Brilliant.

Updated mod to logic too thanks.

Well all the conditions nearly aligned this morning, some light stuff over and on other side of the river (but nothing like our normal Pea Soup) however it all quickly turned to rain. :)

Then Fog increased : Then Rain Stopped.

Are the later 2 expected description (no space between Fog..).

And then Just Fog. Admittedly that's fudged at < 250 ft (was actually 246 ft - AGL) Images depict my ASL (which is +95 ft).

It's actually Patchy light fog, so now I'll be able to refine it over time. :clap:

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Wed 25 Mar 2015 11:25 pm
by beteljuice
Darn ... another 'legacy' hangover

EDIT: Incorrect code snippet *REMOVED*

@HRVistaWeather ....

You managed to get a sequence of conditions that didn't happen in testing :clap:
Normally you wouldn't get an advisory of fog AND rain, but in the logic there is actually a 5 minute window where this could occur .... and you found it :D

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Wed 25 Mar 2015 11:34 pm
by BeaumarisWX
Thanks Beteljuice,

Love squashing Bugs.

Still not quite there though.

Latest results in,
Fog, , Cool, Light air, Temperature Rising Slowly, Barometer Steady.
For conditions at the time should have been,
Fog, Cool, Light air, Temperature Rising Slowly, Barometer Steady.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Thu 26 Mar 2015 9:23 am
by beteljuice
I should have realised ... there was quite a bit of fiddling to get 'grammar' correct, especially when items may be omitted by design or option.

The beteljuice has serious demands on his attention elsewhere ATM - "round to it" job I'm afraid.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Sat 11 Apr 2015 12:12 am
by BeaumarisWX
After extensive monitoring and analysis, (Cumulus) calibration factor for RH adjusted and all seems to work perfect now Min Cload set to 10M in Conditions Script and works perfect.

Regards,

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 07 Sep 2015 5:42 pm
by zcars12
Hello there Beteljuice

Just an acknowledgement of thanks for the effort and time you have put into "concocting" this script. It certainly is magic stuff. Looks and works just right.

Also a shout out to JennyLeez who I understand played her cards at the right time :)

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Tue 08 Sep 2015 1:09 am
by beteljuice
Also a shout out to JennyLeez ...
... Better make that a BIG shout :clap:

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Fri 18 Sep 2015 9:23 pm
by BeaumarisWX
Fog Sorted, thanks Beteljuice.

1st Graphic is a JPGraph using MySql and Webcam image for background.
2nd is Dashboard graphic which shows script returning "Fog,".

Just need to align the Current Conditions script with CloudBase Graphic which is Misty, should be Fog.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 02 Nov 2015 5:51 pm
by philpugh
Attached is a very slightly amended version of curconditions.php (named curconditions.txt to prevent any mishaps and allow uploading!)

I have amended the barometer trend logic to reflect the wording and values in use by the Met Office for their marine forecasts. These forecasts use very precise wording and it seems a shame not to use them!

The three areas that have been changed are preceded by a comment containing "Pugh". A search should reveal these areas.

Don't forget to change extension back to .php if you intend to try it.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Mon 02 Nov 2015 5:51 pm
by philpugh
Attached is a very slightly amended version of curconditions.php (named curconditions.txt to prevent any mishaps and allow uploading!)

I have amended the barometer trend logic to reflect the wording and values in use by the Met Office for their marine forecasts. These forecasts use very precise wording and it seems a shame not to use them!

The three areas that have been changed are preceded by a comment containing "Pugh". A search should reveal these areas.

Don't forget to change extension back to .php if you intend to try it.

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Tue 03 Nov 2015 5:19 am
by beteljuice
philpugh wrote:Attached is a very slightly amended version of curconditions.php (named curconditions.txt to prevent any mishaps and allow uploading!) ....
This will FAIL without amended language support files !!!!!

Re: Cumulus ‘Current Conditions’ Alternative v3.0

Posted: Tue 03 Nov 2015 1:42 pm
by philpugh
Apologies for that! Working for me though?