Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

Yet Another Dayfile Reader (PHP)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Mon 03 Feb 2014 11:04 pm

Don't I remember that there is a 'repair' facility, or is that for one of the other files ?
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Mon 03 Feb 2014 11:41 pm

OK - another fix that may or may not work !

Can someone with a dodgy group of wind readings please tell me what happens with the averages.

Plus the beteljuice has relented and given wind speeds (but not wind run) 1 decimal place.

Plus mouseovers on year averages work they way they should have done - but I was being lazy :mrgreen:
Image
......................Imagine, what you will KNOW tomorrow !

water01
Posts: 1487
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 » Tue 04 Feb 2014 12:20 am

Worked OK for me once I fixed this code error in line 478.

Believe

Code: Select all

    $wind_dec = ($dataSet == 'windrun' ? 0, 1);   
should be

Code: Select all

    $wind_dec = ($dataSet == 'windrun' ? 0 : 1);   

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 12:54 am

:oops: - typo in the 'production' version (now fixed) - thank you
Image
......................Imagine, what you will KNOW tomorrow !

Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Graham64 » Tue 04 Feb 2014 1:59 am

The average for Oct 2013, for wind speed, is the same as before the fix, 3.0. It has summed all 31 values including 17 zeroes and divided by 31.

See http://poundstockpacket.org.uk/weather/basic.php

Pity about the decimal place!

Incidentally, I also have had similar problems with temperature when my Davis sensor failed in July 2012. I wanted to store null but couldn't. In the end I cheated and calculated some averages values and recorded them - don't tell the Met Office!

However it is something that I need to think about. Maybe Mark's solution of a database that can be edited is the best solution. But then what about the NOAA reports?

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 2:23 am

As things stand, I'm afraid you would have to 'nullify' (,,) those entries in the dayfile in order for those averages to be correct.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by steve » Tue 04 Feb 2014 8:10 am

beteljuice wrote:Don't I remember that there is a 'repair' facility, or is that for one of the other files ?
The editor can create missing entries in dayfile.txt from the monthly logs; it would never create null items.

The solution to null items in Cumulus itself isn't easy (and I see that certain other popular software avoids the issue also, so I'm certainly not going to beat myself up over this). I wanted the CSV logs to be able to be used directly in spreadsheets or other software packages for analysis and graph plotting etc, and there is no standard for 'null' values using normal numbering which would be understood by all software.

Internally, a database would be the best way to go, as those have proper support for nulls. You still have the issue of what to do if you want to export some data to use in a spreadsheet...
Steve

Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Graham64 » Tue 04 Feb 2014 12:47 pm

Beteljuice
Null values
I have manually 'nullified' some of my missing wind speed & wind run values for Oct 2013.
The zeroes are now shown as blanks and the monthly average is calculated only of the real values.
There is an asterisk shown against the average to show that the data is in-complete.

See http://poundstockpacket.org.uk/weather/basic.php, 2013, October.

So the logic and program is a 'proper job' as we say in Cornwall, thanks.

The only problem now is to find a way to make the 'missing values' in Dayfile.txt always null!

UV values
I have been trying to stop the UV button displaying, I changed true to false in the $label_items array:

Code: Select all

'HighUV' => array($translit[$lang]['HighUV'][0], $translit[$lang]['HighUV'][1], false, 44, null, 'ah')
This stops the UV button from displaying initially but when I change year the button returns. Is that something to do with the cookies or am I missing something?

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 2:34 pm

@ Graham64

Thanks for confirming behavour of 'null'

RE. UV button - I like that ! It happens on ALL kinds of subsequent calls.
Have you got more than one version of betel_readDayfile ?

Edit:
In order for the 'Ajax' calls to work the file MUST be called betel_readDayfile.php unless you also change the name in the JavaScript function doesforme()
No longer applicable

@ ALL

Experimented with shoehorning into 750px width (and a few other tweaks) Edit: old link removed

Thoughts please, this is probably going to be 'beta' release.
Last edited by beteljuice on Wed 11 Jun 2014 3:01 pm, edited 3 times in total.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
jdc
Posts: 135
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10 : Win XP
Location: Berwick-upon-Tweed, England.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jdc » Tue 04 Feb 2014 4:03 pm

The only thing I can find is Sunshine isn't totalling on Daily page. Rain, windrun etc is OK.

I've added another series but not getting totals/avg/hi, but that is most likely my lack of php knowledge.

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 5:58 pm

jdc wrote:The only thing I can find is Sunshine isn't totalling on Daily page.
You're not wrong, I must have 'lost' it with one of the many tweaks - I'll investigate later.
I've added another series but not getting totals/avg/hi, but that is most likely my lack of php knowledge.
'Normal' stuff has the 'flags' set in the $labels_list ( 'a' AND/OR 's' AND/OR 'h' AND/OR 'l' OR null - display (a)verage and / or (s)um, (h)i, (l)o for month(s)), and the routines work with the 'native' values.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 6:20 pm

Was an incomplete 'tweak' - Total Sunshine hours will be fixed in next release.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
jdc
Posts: 135
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10 : Win XP
Location: Berwick-upon-Tweed, England.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jdc » Tue 04 Feb 2014 10:02 pm

Got Evapotranspiration sorted using your latest release, above, with 'rainfall' settings (and in 550px container :o ) here.

Thankyou.

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 11:09 pm

Still too tight I'm afraid John ...
The whammies are baro hPa, especially if there is an * in front
But at that scale you might get away with it, without it being too much of a wobble.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice » Tue 04 Feb 2014 11:30 pm

Beta release now Out

but there will no doubt be things to change !
To those who have graciously translated, there are a few more options now I'm afraid :shock:
Image
......................Imagine, what you will KNOW tomorrow !

Post Reply