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

User avatar
laulau
Posts: 521
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by laulau » Sun 02 Feb 2014 4:12 pm

This is what happens with the basic code:
Capture.JPG
With my code modification i have no more Warning messages but you're right it affects the average value.
Could you try with my dayfile ?
You do not have the required permissions to view the files attached to this post.
Laurent

Image

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nitrx » Sun 02 Feb 2014 4:59 pm

Aha found it for windspeed / gust it seems the m/s and km/h are reverted (don't know about the knots and miles) The easiest way should be the change the descriptions I think, but I'm not sure if others have this problem too.

edit found it canged km/h over here to m/s 'wind' => (isset($SITE['uomWind']) ? substr($SITE['uomWind'], 1) : 'm/s'), dumbo me sorry for the inconvenience should read better :mrgreen: Windrun is broken now :(

mikkimii
Posts: 42
Joined: Fri 23 Mar 2012 3:17 pm
Weather Station: Davis VP2
Operating System: Windows 7 x64 Pro
Location: Vilppula, Finland

Re: Yet Another Dayfile Reader (PHP)

Post by mikkimii » Sun 02 Feb 2014 5:27 pm

nitrx wrote:Aha found it for windspeed / gust it seems the m/s and km/h are reverted (don't know about the knots and miles) The easiest way should be the change the descriptions I think, but I'm not sure if others have this problem too.

edit found it canged km/h over here to m/s 'wind' => (isset($SITE['uomWind']) ? substr($SITE['uomWind'], 1) : 'm/s'), dumbo me sorry for the inconvenience should read better :mrgreen: Windrun is broken now :(
Yes, I changed same line same way yesterday and had same issue, windrun went broken.

In Scandinavia we use m/s for wind speed.
Br,
Mika
Image

User avatar
KarlS
Posts: 74
Joined: Tue 30 Nov 2010 3:01 pm
Weather Station: National Geographic 265NC
Operating System: Windows 7 x86
Location: Bridge Lake, BC, Canada
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by KarlS » Sun 02 Feb 2014 6:50 pm

I changed the CSS a bit to accommodate it to my page layout (cell width, background colors) and did some minor modifications to the script (no Sunshine hours, UV index) … and had it running within an hour. I plan to make some additional changes (add apparent temperature and/or windchill), so it is not yet selectable from my menu, but for now here it is.

Thank you Beteljuice et al. for this useful scrpt. :) :)

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 » Sun 02 Feb 2014 7:25 pm

@ laulau - that link IS using YOUR dayfile !

Guys, It's all getting a bit grey.

Please can we determine what is working and what isn't - AND can you please check if your data is valid !
eg. a wind value of 0 is valid - if you didn't record a value it should be null eg. ,'';
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nitrx » Sun 02 Feb 2014 7:35 pm

Values are valid exept windrun isn't calculated I think this happens due my default windmeasures are in m/s and the windrun is in km by default.

Ron http://apeldoorn.tk/weer/basic.php

User avatar
laulau
Posts: 521
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by laulau » Sun 02 Feb 2014 10:00 pm

Your original code give me some warnings in "Wind Speed" before the data table
I suppose due to empty cells in dayfile for older data.
Capture.JPG
--
beteljuice wrote:@ laulau - that link IS using YOUR dayfile !
Ok when i go to the link http://beteljuice.co.uk/daytest/lau.php
These are my datas (2002->2014)
Capture1.JPG
But after i've clicked on "Temp Max"
The text button are in English and the datas are from someone else(oct 2008 to jan 2014)
Capture2.JPG
I Really don't understand what happens:o :shock:
You do not have the required permissions to view the files attached to this post.
Laurent

Image

User avatar
PaulMy
Posts: 1731
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by PaulMy » Sun 02 Feb 2014 10:18 pm

But after i've clicked on "Temp Max"
The text button are in English and the datas are from someone else(oct 2008 to jan 2014)
I think that is my data that I rented out to beteljuice when he was helping me a while ago.

I hope you get it all worked out so that I can jump in as well.

Paul

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 12:11 am

@ Laurent

Sorry - I forgot to change something on line #1235 :lol:

Subsequent calls should now properly refer to your data.
ATM I'm confused why some font sizes seem to be ignored when combined with weatherstyles.css - an 'inspector' says they are still enforced, but obviously they are not ?
I hate css ........

@ Paul

Yes, I still haven't got anyone with years of entries and a 'clean' (no errors) database :shock:

If it's a problem please say - the 'release' code does not show your url.
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 2:57 am

'native' m/s windrun fixed ... my oops !
rain conversion corrected - thanks jdc

@ Ron

Averages:
The sum of 'valid' data / number of valid data entries in a month.
The 'overall' averages (bottom line of main table) are the averages of the (counted) month averages.
The seasonal works in a similar way but using 3 months valid data / valid entries
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
PaulMy
Posts: 1731
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by PaulMy » Mon 03 Feb 2014 5:13 am

@ beteljuice,
No problem at all, use it at your convenience...

Paul

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nitrx » Mon 03 Feb 2014 8:57 am

beteljuice wrote:'native' m/s windrun fixed ... my oops !
rain conversion corrected - thanks jdc

@ Ron

Averages:
The sum of 'valid' data / number of valid data entries in a month.
The 'overall' averages (bottom line of main table) are the averages of the (counted) month averages.
The seasonal works in a similar way but using 3 months valid data / valid entries
Thanks Beteljuice evrything is up and running fine now.

What do you mean with
@ Paul

Yes, I still haven't got anyone with years of entries and a 'clean' (no errors) database :shock:


About the seasons
The seasonal works in a similar way but using 3 months valid data / valid entries
I've looked at this winter , february isn't completed yet so the average is dec+jan+(incomplete-feb) divided by 3 as far I can see , there is an * that indicates it's not complete but... it would be nice to have the trending season to be the sum of days divided by the days in the season, or am I asking too much :lol:

Anyway thanks for this great script !
Ron

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 10:27 am

Ron wrote:it would be nice to have the trending season to be the sum of days divided by the days in the season, or am I asking too much :lol:
Quite straight forward, and yes with incomplete months there is a difference ! - with completed months there is sometimes 0.1 difference (due to rounding)

(temporarily on my test page) Edit: link no longer valid
Today 2014 Winter season Average Max Temp was -1.2C, day-by-day method now -1.9C

But .... I am not sure which is the "correct" method to use.

Anyone got a 'source' ?
Last edited by beteljuice on Tue 18 Feb 2014 4:27 am, edited 2 times in total.
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 » Mon 03 Feb 2014 10:32 am

I have just noticed that in the wind data pages (i.e. Wind Speed, Wind Gust, Wind Run) I am getting 0"> instead of zero.

Tried to find where this occurring, I can see what is happening in the table data generated by the php

Code: Select all

<td class="datacell" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" datamon=".Feb">0"> </td>
but cannot find the problem in the code, obviously not conversant enough with it yet!!

If you want to check it out see here http://www.dmjsystems.co.uk/weather/basic.php and choose Wind Run year 2012.

User avatar
nitrx
Posts: 1292
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nitrx » Mon 03 Feb 2014 11:56 am

beteljuice wrote:Quite straight forward, and yes with incomplete months there is a difference ! - with completed months there is sometimes 0.1 difference (due to rounding)

(temporarily on my test page basic
Today 2014 Winter season Max Temp was -1.2C, day-by-day method now -1.9C

But .... I am not sure which is the "correct" method to use.

Anyone got a 'source' ?
I've not a direct source but this is a Dutch site (unfortenally) that calculates averages over a given period when I look up the perod 1 dec 2012 to 28 feb 2013 it gives an average of 2.9 C and for the period 1 dec to 2 febr 2013 3.6 C . (not sure how it should be handled according the WMO). I'm aware of the 0.1 rounding

edit The KNMI (Dutch metoffice) calculates the monthly average from the sum of the temps divided by the past days

Post Reply