Page 1 of 1

Yet Another Forecaster

Posted: Sat 08 Sep 2012 12:17 am
by GraemeT
For a few weeks now I've been testing an alternative method of calculating a 'local' forecast.

I feel it's now at the stage for others to evaluate/use/bag or whatever.
I've put the code in a .zip file here: http://weather.gktnet.com/public/weathe ... cripts.zip

This method uses a php version of Beteljuice's Zambretti Forecaster to do the work.
The forecaster is called at 12-hour intervals as a Windows scheduled task and produces a small text file, which can be easily imported for display in a web page.

My variant of the Zambretti code returns an array to the calling php containing a forecast number (0-26) followed by the forecast description.
The forecast number can then be used to display a graphic, such as Jacques' day/night forecast set, with the description being used as a caption etc.

Here is how the scripts work:
The task scheduler task runs forecast.vbs, which calls FCast.php, which in turn calls Zambretti.php
FCast.php then writes a file called FC.txt to disk.

The only critical part is setting up a scheduled task and setting paths in the files.

I would welcome any comments, criticisms, etc.

Re: Yet Another Forecaster

Posted: Sat 08 Sep 2012 12:48 am
by beteljuice
You forgot to mention required 'environment' eg. require_once("../cumuluswebtags.php"); ;)
and why a seperate 'flag' for forecast and number ?

As you are using php why not call once to create an array (two entries), then echo the part(s) you want ?

... but ... surely you are duplicating the Cumulus forecast, or have I missed something :?

Re: Yet Another Forecaster

Posted: Sat 08 Sep 2012 1:27 am
by GraemeT
beteljuice wrote:You forgot to mention required 'environment'
cumuluswebtags.php is referenced in FCast.php and can be assumed to be already used in the user's webpage.
beteljuice wrote:and why a seperate 'flag' for forecast and number ?
I still have need for just the forecast number in another function I'm playing with, so setting the fcst flag signals the function to just return that value.
beteljuice wrote:call once to create an array (two entries)
(Edited out my dumbest answer ever) :oops: Yes, that might be done in the future.
beteljuice wrote:... surely you are duplicating the Cumulus forecast
The cumulus forecast changes almost every time cumulus updates and it really should be stable, so a 12-hour schedule seems the way to go, and (so far) it's been relatively close to what I'd expect for my location. (within the limits of the crystal ball)