Page 4 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 1:39 pm
by beteljuice
edit The KNMI (Dutch metoffice) calculates the monthly average from the sum of the temps divided by the past days
... but what about an incomplete season ?

I beginning to think that it should be the day-by-day method, but then again ......

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 2:35 pm
by beteljuice
Yet Another Update :lol:

Method of Seasonal Daily averages changed - although it may yet be the 'wrong' way.
attempted logic problem fix.

@ David

I knew there would be at least one like this - It's a situation where a numeric value of zero is being mistaken for false or null.

I'm not sure yet if I've fixed it or made things worse :?

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 3:18 pm
by Graham64
I had the same problem with zero wind speed values as David.
The latest fix has solved the problem - thanks.

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

I have a problem with the data because my anemometer failed. Really the wind speed should be recorded as null. I'm not sure how to deal with that - Steve has said that Cumulus doesn't record null values. Any suggestions of how to deal with missing data?

Really love the new program, thank you.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 3:18 pm
by nitrx
beteljuice wrote: ... but what about an incomplete season ?

I beginning to think that it should be the day-by-day method, but then again ......
Me too :roll: Anyway it's an indication ,averages over a day are officially calculated over 24 hours with a measurement each hour by the Dutch Met Office, all other averages are calculated from these hourly measurements. Cumulus has two averages the minute average and the max/min average ... I choose for the daily minute by minute.

I don't know what average is used in the dayfile.txt ? Perhaps Steve can give a clue ?(I haven't searched in the wiki btw)

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 3:29 pm
by nitrx
false post

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 3:34 pm
by nitrx
nitrx wrote:
beteljuice wrote:Yet Another Update :lol:
Uhhh its broken ? http://apeldoorn.tk/weer/basic.php

Please ignore ! have to validate , later.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 4:02 pm
by mikkimii
nitrx wrote:
beteljuice wrote: ... but what about an incomplete season ?

I beginning to think that it should be the day-by-day method, but then again ......
Me too :roll: Anyway it's an indication ,averages over a day are officially calculated over 24 hours with a measurement each hour by the Dutch Met Office, all other averages are calculated from these hourly measurements. Cumulus has two averages the minute average and the max/min average ... I choose for the daily minute by minute.

I don't know what average is used in the dayfile.txt ? Perhaps Steve can give a clue ?(I haven't searched in the wiki btw)
http://wiki.sandaysoft.com/a/Average_temperature ;)

Wind run is ok now in m/s units, but I still don't like rounding wind speeds when using m/s wind units...

http://www.phpoint.fi/leka446/weather2/inc/basic.php

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 4:20 pm
by water01
I had the same problem with zero wind speed values as David.
The latest fix has solved the problem - thanks.
I can also confirm that the latest version fixed the zero value problem in the Wind Gust etc.

Many thanks.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 5:36 pm
by mcrossley
beteljuice, I notice on your demo that the mouseover on the 'average table' cells highlight the row/column headers on the main 'data table'.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 7:59 pm
by beteljuice
Gentlmen (and ladies)

I have a problem that is both logical and philosophical ...........

Wind Speed and Gust are NOT fixed.
I am having to assume that a value of 0 (zero) is valid, but it may not be !
On the occasions that it has been 'injected' by Cumulus as a 'null' value (because of eg. anemometer malfunction) it makes a nonsense of the averages.

I could insist that whatafter all is a day value MUST be more than 1 'native' unit, but there ARE places and times that 0 (zero) WOULD be valid data and should be taken into account with the averages.

Ideally users who know they have invalid wind zero data would simply remove it from the dayfile.txt - but this could be a difficult task for some.

I don't know if the Cumulus editor will allow 'null' or if a rebuild is done, will it reinstate 0 or 0.0 ?

Thought please ...

@ Mark OK, OK - I was going to wait to do that - Edit: old link removed

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 10:35 pm
by steve
beteljuice wrote:I don't know if the Cumulus editor will allow 'null' or if a rebuild is done, will it reinstate 0 or 0.0 ?
What do mean by a 'null' value - an empty field in the dayfile.txt? Cumulus shouldn't be doing that. Cumulus in general doesn't do 'nulls'.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 10:37 pm
by mcrossley
This has come up before, Cumulus doesn't have a concept of 'null' values, which does cause the problems you are wrestling with. This is one of the reasons I have moved to a database, I can easily null out values/days I know are not valid for whatever reason.

Edit: Cross posted with Steve!

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 10:52 pm
by beteljuice
@ Steve

Yes Boss,

1/ Will the editor allow edit to empty fields ?

2/ On a rebuild would empty fields be populated with zero ?

1 - I don't know
2 - I suspect not, as I haven't (yet) seen any 'old' records that have been padded out. (AFAIK)

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 10:54 pm
by laulau
Hi,
I had to modify line 509 of your code like this

Code: Select all

        return number_format($value * 1.0, $wind_dec, '.' , '');
to have it working here :o
Then i try to add a decimal point (

Code: Select all

$wind_dec = 1;
the value comes out with the decimal point but no more "background coloring" :o :o

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 03 Feb 2014 10:57 pm
by steve
beteljuice wrote:1/ Will the editor allow edit to empty fields ?
It appears that it does. That's probably not good, as it's probably going to cause a problem somewhere.
2/ On a rebuild would empty fields be populated with zero ?
What do you mean by a 'rebuild'?