Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Yet Another Dayfile Reader (PHP)

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

Moderators: daj, TNETWeather

colinpb
Posts: 86
Joined: Thu Nov 10, 2011 8:14 pm
Weather Station: VP2+SHT31+DFars+Solar+AeroCone
Operating System: Windows 10
Location: Hemel Hempstead, Hertfordshire, UK

Re: Yet Another Dayfile Reader (PHP)

Postby colinpb » Wed Jun 10, 2015 8:16 pm

My explanation wasn’t as clear as it should have been. Hopefully the following will be clearer.

1. Sunshine hours from 2015 April May June, Fig A shows High values from the summaries in Daily View and Season View.

Fig A.PNG


2. To clarify I had no VP2 solar sensor until September 2012, therefore there are no values for June July and August 2012. Logic in deriving solar w/m2 average is correct, see Fig B.

Fig B.PNG


Logic used in Sunshine Hours and ET incorrect and skewing average because 0.0 has been entered for each of these 3 months; see Fig C. See Fig D for correct values using logic used in solar (Fig B)

Fig C.PNG



Fig D.PNG


Just noticed slight rounding error in Fig C 3.6 v 3.7

Colin
You do not have the required permissions to view the files attached to this post.

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

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Wed Jun 10, 2015 10:40 pm

Please read through the later parts of the thread (although it is rather long) regarding either the need to nullify incorrect data or turn on or off "zero as null" options.

Sorry I'm not very helpful ATM ...... personal mental downtime.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
kocher
Posts: 60
Joined: Sat Apr 19, 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby kocher » Wed Aug 19, 2015 10:02 am

Cheers

Congratulations for this wonderful work. :D
I love the amount of data it provides and the beautiful design:

http://kocher.es/cumulus_estadistica.php

I wonder if it would be possible to add a small table to present the total monthly average values (from the commissioning of the station).

Edit

I was thinking of rainfall data. I see the daily monthly average, but I'm interested in the total monthly average of all years.

The result would be something like this:

http://kocher.es/central.php

Saludos desde San Sebastian
Last edited by kocher on Mon Jun 20, 2016 9:24 am, edited 2 times in total.
Windows 10
Davis Vantage Pro Plus
WeatherLink 6.0.2
cumulusMX
Meteotemplate

Image

iandrews
Posts: 48
Joined: Sun Jan 03, 2010 10:57 am
Weather Station: Davis Pro2
Operating System: Windows 2012R2
Location: London

Re: Yet Another Dayfile Reader (PHP)

Postby iandrews » Fri Sep 25, 2015 10:03 am

First off, thanks to beteljuice (and others) who have worked on this.

I was using an older PHP version found here, http://wiki.sandaysoft.com/a/AnnualDataSummary and can’t 100% remember, but may have made some changes to add the colour scale when it was set up several years ago. I only ever got a basic page set up, and it can be seen here: http://weather.wanders.me.uk/weather/hi ... ummary.php

I was upgrading to a new server to host my PHP pages, and was looking around to see if there was updated code, and that is how I found this thread. I download the files, and with 10 mins or so had the web page up.

I updated my weather station in April this year to a Davis Pro with solar & UV sensor, so have no data for those readings before then. In inr PHP code I had the default setting for Nullify 0 data set to true, and the default entry’s in the array (so included sunhours / solar / UV). When I clicked on any of the 3 buttons for these all looked ok with the cells before April this year (and for all previous years) being blank. Also the Avg table at the bottom of the page looked ok and just showed a row for 2015, with Jan / Feb / March being blank, and data in the rest of the months that have passed being correct.

Now, the only issue with that is that I have had some (true) 0 sunhours hours in the last few months, and those were being blanked out of the main table, and as such skewing the monthly day average.

Now I have spent an hour (or more) reading the whole thread, and found (and understood) about nullifying the 0’s for the relevant solar data in the dayfile.txt and removing the sunhours / solar / UV entries from the “Nullify” array.

So I spent an hour last night removing the 0’s from (a copy) of the dayfile.txt, I then uploaded it to my server, and removed the sunhours / solar / UV entries from the “Nullify” array. The Sunshine page then looked like the attached.

Cells for before April were blank, and true 0’s were still displayed in the data, and taken into account when working out the monthly day average. HOWEVER the Ave table below was now incorrect. It was now showing a line for all years I have data for (from 2010), and (apart from the few months for this year where I do have data) all were showing 0’s. This then totally skews the Avg line at the bottom.

Now, not sure if I have done something wrong, need to do something else, or this is just the way it is, but it seems that the code for the Avg table isn’t taking into account the null values. So it seems that as it stands (even with my data “Nullifed” I either have sunhours / solar / UV entries in the “Nullify” array and the Avg table at the bottom is correct, but “true” 0 data is removed from the main table, or I have them removed from the “Nullify” array and the main table is correct, but the bottom Avg table isn’t.

For info, my page can be seen here: http://weather.wanders.me.uk/weather/historic/basic.php as it stands the 0’s aren’t nullified out (as the file got automatically overwritten last night with a non nulled version) and sunhours / solar / UV entries are not in the “Nullify” array, that’s why data from before April is showing 0’s.

Ian.
You do not have the required permissions to view the files attached to this post.

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

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Fri Sep 25, 2015 11:48 am

Hmmm ........
Anything 'solar' was always a bit of a 'bodge' - especially because of your circumstances where there is no data before an upgraded kit.

I suspect you may have to accept it as is - but if I can reactivate my jaded brain cells I'll have a think about it ...

Edit: ATM I can't remember if the same thing happens in the same convoluted circumstances for non-solar data.
Image
......................Imagine, what you will KNOW tomorrow !

iandrews
Posts: 48
Joined: Sun Jan 03, 2010 10:57 am
Weather Station: Davis Pro2
Operating System: Windows 2012R2
Location: London

Re: Yet Another Dayfile Reader (PHP)

Postby iandrews » Fri Sep 25, 2015 1:08 pm

beteljuice wrote:
Edit: ATM I can't remember if the same thing happens in the same convoluted circumstances for non-solar data.


Over the weekend I will try to "Null" out some other values, such as "Max Temp" for a year or 2, and see what happends.

Ian.

iandrews
Posts: 48
Joined: Sun Jan 03, 2010 10:57 am
Weather Station: Davis Pro2
Operating System: Windows 2012R2
Location: London

Re: Yet Another Dayfile Reader (PHP)

Postby iandrews » Sun Sep 27, 2015 7:11 pm

So, I deleted (nulled) out a couple of years worth of MaxTemp data (I removed Jan 2010 to April 2012), and I got the same as with the Solar data. With MaxTemp not in the Null array I got lots of 0's in the bottom Avg table (temp.jpg) which skews the Avg's, and with MaxTemp in the Null array I got "nothing" before the data started and the Avg's look ok (temp1.jpg).

Though the Seasonal table with MaxTemp not in the Null array shows 0's for the missing data (temp2.jpg) it does seem to show the same Avg for Spring 2012 for when it is in the Null array (temp3.jpg).

Ian.
You do not have the required permissions to view the files attached to this post.

User avatar
Mapantz
Posts: 464
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby Mapantz » Thu Mar 10, 2016 4:08 pm

As I mentioned in another thread, I'm a bit late to the party with these scripts- again, thank you for allowing us to use them!

Quick question: Is there a version floating around, that will pull the data from MySQL?

Many thanks.
Image
Image

User avatar
mcrossley
Posts: 5006
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby mcrossley » Thu Mar 10, 2016 4:37 pm

Mine uses MySQL, but it diverged from this version a while back, and aged - it doesn't have the new bells and whistles that have been added by beteljuice.

Mrc
Posts: 9
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Yet Another Dayfile Reader (PHP)

Postby Mrc » Thu Jun 30, 2016 9:56 pm

Hi. I just found this dayfile reader and i would like to use it but there's a problem: there's no data.
I think my addres to dayfile is correct because it doesn't say 'error reading dayfile' or something like that anymore. I uploaded all the files and configured cumulus settings but still no data.
Here's a link:
http://www.kesis.info/Saa/betel_datasummary.php

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

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Fri Jul 01, 2016 1:04 am

... it doesn't say 'error reading dayfile' or something like that anymore.
That suggests you had a problem earlier !

It obviously can't "see" your data for whatever reason. Double check your paths from where the file is located.
Image
......................Imagine, what you will KNOW tomorrow !

Mrc
Posts: 9
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Yet Another Dayfile Reader (PHP)

Postby Mrc » Sat Jul 02, 2016 2:47 pm

beteljuice wrote:
... it doesn't say 'error reading dayfile' or something like that anymore.
That suggests you had a problem earlier !

It obviously can't "see" your data for whatever reason. Double check your paths from where the file is located.


I've tried several adresses, like $dayfile = 'dayfile.txt'; $dayfile = '/Saa/dayfile.txt'; $dayfile = '../Saa/dayfile.txt'; but still no data :(

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

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Sat Jul 02, 2016 9:31 pm

Two problems, looking at your realtime.txt ..
In the prog. you have ...

Code: Select all

 $dayfile = 'dayfile.txt'; // to work correctly this should be a relative address NOT full url

$field_delimiter = ',';
$date_delimiter = '/';
... but your $field_delimiter = ';' and $date_delimiter = '.' ;)
Image
......................Imagine, what you will KNOW tomorrow !

Mrc
Posts: 9
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Yet Another Dayfile Reader (PHP)

Postby Mrc » Sun Jul 03, 2016 7:01 am

beteljuice wrote:Two problems, looking at your realtime.txt ..
In the prog. you have ...

Code: Select all

 $dayfile = 'dayfile.txt'; // to work correctly this should be a relative address NOT full url

$field_delimiter = ',';
$date_delimiter = '/';
... but your $field_delimiter = ';' and $date_delimiter = '.' ;)


Thank you, i was focused only at the adress, now it works!
Thanks!! :)

User avatar
JennyLeez
Posts: 283
Joined: Wed Dec 16, 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby JennyLeez » Sun Jul 03, 2016 12:51 pm

-17.8 in January :shock:
Thats gotta be cold.

Summary looking good :)
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image


Return to “Web site - General”

Who is online

Users browsing this forum: Bing [Bot] and 7 guests