New Zealand Local Weather Forum

Weather Discussion => Hardware Software and Technology => Weather Display => Topic started by: gabba on March 04, 2012, 04:06:29 PM

Title: Script for collecting yesterday's extremes
Post by: gabba on March 04, 2012, 04:06:29 PM
Hi all

I've been using a script to collect up my daily extremes - then copying and pasting the data into the extremes thread. I've made some minor modifications to it, and am providing it for others to use. The key advantage of this approach is obviously that it is quick, and puts everything into the right order / format - making the job  to summarise the data alot easier.

Pre-requisites and instructions:
You will need to be running the weather scripts from Saratoga weather http://saratoga-weather.org/wxtemplates/Settings-config-World.php (http://saratoga-weather.org/wxtemplates/Settings-config-World.php)
You are most likely to need to run Weather Display - At some stage I will test it on Cumulus but right now I haven't
You will need to edit the file. Search for a string "Enter your station name, location here" and replace it with your station name and location
Upload the file. It needs to sit in the same directory as your testtags.php file (along with your Settings.php and common.php files)

Once you've uploaded it, access the file through your web browser. You should be able to see yesterdays stats immediately.

My thanks go to Ken True (SaratogaWX) for the core of this script and his wonderful set of weather scripts. If you wish to make modifications to the file please attach your version back here so we can all benefit from your knowledge

NOTE: Scroll down to the bottom of the thread to see the latest version of this file
Title: Re: Script for collecting yesterday's extremes
Post by: gabba on June 30, 2012, 09:46:51 AM
I've updated the script to reflect the updated requirements for reporting. It now reports the following:

Maximum Temperature:
Minimum Temperature:
Rainfall Total Yesterday:
Month Rainfall Total so far:
Maximum Wind Gust:
Maximum Average Wind Speed:
Total Day’s Wind Run:
Maximum Pressure:
Minimum Pressure:

plus a few other metrics

Please update your older version with this version
Title: Re: Script for collecting yesterday's extremes
Post by: beteljuice on June 30, 2012, 12:32:44 PM
Minor omission - line 108
Month Rainfall Total so far = <?php echo unUnit($monthrn) . $uomRain?><br/No closing > at end of line.
Title: Re: Script for collecting yesterday's extremes
Post by: OhauitiWeather on June 30, 2012, 01:15:06 PM
Hi there Gabba

Thanks for your efforts.  Look forward to the results of your Cumulus Testing.

I presume that the output is UTF-8 compliant and all you need to do is copy/paste to a post in the Yesterdays Highs and Lows thread on the Forum?

Kind Regards
Title: Re: Script for collecting yesterday's extremes
Post by: JennyLeez on June 30, 2012, 01:27:59 PM
Hi David,
It is made for Weather Display and those using the WX templates.
It does however grab half of the cumulus data if using the WX templates.
Cheers

Footnote:
Cumulus WX templates do not use testags.
They use a smaller version called CUtags.php

The script could be written to read in the correct values for cumulus WX web sites.
However script of no use for basic Cumulus users.
Title: Re: Script for collecting yesterday's extremes
Post by: JennyLeez on June 30, 2012, 01:35:07 PM
Thinking along those lines for Basic Cumulus.
David you could make a page. Get Cumulus to process it.
Get Cumulus toolbox to upload it once a day.
I will talk with Te Puke. If interested I will send him mine :)
Cheers
Title: Re: Script for collecting yesterday's extremes
Post by: Weather Display on June 30, 2012, 02:09:58 PM
or
all your cumulus users switch to WD

hehehe
joke
hehehe



also make sure to have a properly shielded temperature sensor if you are to be submitting data to the extremes....
Title: Re: Script for collecting yesterday's extremes
Post by: JennyLeez on June 30, 2012, 02:14:48 PM

and I am soooooo  biting my tongue....lol
Title: Re: Script for collecting yesterday's extremes
Post by: gabba on June 30, 2012, 02:36:27 PM
Month Rainfall Total so far = <?php echo unUnit($monthrn) . $uomRain; ?><br/[/code]No closing > at end of line.

Bad Syntax. Naughty, naughty naughty! :)
Title: Re: Script for collecting yesterday's extremes
Post by: Derek on June 30, 2012, 06:33:24 PM
Yes, have seen plenty of false highs being reported in my time...

Also would comment that the use of a script to generate the data to do a quick copy and paste in to a thread is a great time saving method to use, but it can be tempting to do just that - cut and paste.  It pays to check the data first to make sure something screwy hasn't occurred and that an obviously wrong value hasn't been generated - I've seen it happen plenty of times. 

Good to always have the human interface involved too!  :D