Page 5 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 11:04 pm
by beteljuice
Don't I remember that there is a 'repair' facility, or is that for one of the other files ?

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 11:41 pm
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:

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 12:20 am
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);   

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 12:54 am
by beteljuice
:oops: - typo in the 'production' version (now fixed) - thank you

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 1:59 am
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?

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 2:23 am
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 8:10 am
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...

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 12:47 pm
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?

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 2:34 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 4:03 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 5:58 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 6:20 pm
by beteljuice
Was an incomplete 'tweak' - Total Sunshine hours will be fixed in next release.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 10:02 pm
by jdc
Got Evapotranspiration sorted using your latest release, above, with 'rainfall' settings (and in 550px container :o ) here.

Thankyou.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 11:09 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 04 Feb 2014 11:30 pm
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: