Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

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: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

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);   
David
Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

: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 »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

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: 26702
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 »

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 »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@ 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: 142
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10
Location: Portsoy,.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jdc »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Was an incomplete 'tweak' - Total Sunshine hours will be fixed in next release.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
jdc
Posts: 142
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10
Location: Portsoy,.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jdc »

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

Thankyou.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

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