Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.2.3 build 3059 - 04 December 2019.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    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: 524
    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 12:17 am

    beteljuice wrote:@ Laurent
    Do mean eg. Kilometres ? - I had a Damn Yankee moment, sorry !
    Kilomètres

    And perhaps some others units translations if they could appear (mètres/ secondes or beers/hour :lol: )
    Laurent

    Image

    User avatar
    beteljuice
    Posts: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sun 02 Feb 2014 1:38 am

    fixes to:
    • menu 'line break'
      Auto detect comma as a decimal delimiter (but will output as 1.23 unless there are complaints ;) )
      bug with 'season' years
    New download in first post.

    @ laulau - I've gone right off you !! :lol:

    Re. your 'Vent' problem - I can't duplicate it even when I cut'n'paste your translated section into mine.
    You did remember to edit / save as UTF-8 NO BOM ??

    @ Barry - It's not finished yet !

    Looks like I've got a problem with UV (I didn't have any data to check with) - TO FIX fixed
    You haven't changed your season headings.
    Image
    ......................Imagine, what you will KNOW tomorrow !

    nossis
    Posts: 68
    Joined: Wed 28 Nov 2012 6:12 am
    Weather Station: Station closed
    Operating System: none at present
    Location: No fixed Address

    Re: Yet Another Dayfile Reader (PHP)

    Post by nossis » Sun 02 Feb 2014 2:24 am

    Hi beteljuice

    Ah yes.. noticed the seasons after I posted.. amongst other things...
    Thanks for the update, it fixed the UV index.
    Will have more of a play as time permits. Still in the learning phase of understanding how the code works. I have much to learn

    Sensational work there chief! :D :D :D :D :D :D :D :D :D :D :D

    Barry
    Barry
    Station Closed (Travelling around Australia)

    BCJKiwi
    Posts: 885
    Joined: Mon 09 Jul 2012 8:40 pm
    Weather Station: Davis VP2 Cabled with Solar
    Operating System: Windows 10 Pro
    Location: Auckland, New Zealand
    Contact:

    Re: Yet Another Dayfile Reader (PHP)

    Post by BCJKiwi » Sun 02 Feb 2014 2:59 am

    OK late to the party.

    Running in Southern hemisphere and Saratoga.
    No edits - installed as-is.
    Windir gives me;
    Notice: Undefined offset: 1 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 7 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 2 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 5 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 5 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 6 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 0 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 2 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 1 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 4 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 625
    Notice: Undefined offset: 7 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 798
    Notice: Undefined offset: 5 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 798
    Notice: Undefined offset: 6 in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 798
    etc etc with the proper? chart at the bottom.
    UV Index (which I don't have) gives me;
    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 279
    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 279
    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 279
    Warning: number_format() expects parameter 1 to be double, string given in C:\xampp\htdocs\public_html\weather\betel_readDayfile.php on line 279
    with the proper chart (zero filled for this year so far) at the bottom.

    I don't see either of these issues on other tester's sites (what am I missing?) Other tabs are all OK.

    Seasons are back to front - it suggests we are in mid winter when summer has begun!

    Will dig deeper when I get a chance! (need to make it a bit smaller to fit my layout!).

    Love the clean look!

    EDIT
    Here is a leaf.png to go with the other .png files.
    OK I see the seasons are in the translations so can fix that but long term would be better automated off the latitude - will look at that for you.
    You do not have the required permissions to view the files attached to this post.

    User avatar
    beteljuice
    Posts: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sun 02 Feb 2014 3:41 am

    @BCJKiwi

    The undefined offsets are 'twitch' level error reporting - really an advisory that we are updating something that didn't actually exist before.
    You are probably in 'safe' mode.

    eg. $monWindDir[$m][$wval]++; // creating a 'counter' whose 'key' is the direction (0 > 7)
    Although $monWindDir WAS declared as an array, $monWindDir[$m] wasn't and its array is being created on-the-fly.

    The UV prob. ? - have you downloaded the UV fix version ?

    Seasons - It's in the language section as season_1, season_2, season_3, season_4
    Image
    ......................Imagine, what you will KNOW tomorrow !

    nossis
    Posts: 68
    Joined: Wed 28 Nov 2012 6:12 am
    Weather Station: Station closed
    Operating System: none at present
    Location: No fixed Address

    Re: Yet Another Dayfile Reader (PHP)

    Post by nossis » Sun 02 Feb 2014 6:20 am

    Hi beteljuice,

    In the "uvGrad = array_merge" code....
    Put a comma at end of line 428

    Code: Select all

                    gradient('FF0000','998CFF',30), // 7.0 - 10.0
    Added at line number 429

    Code: Select all

    				gradient('998CFF','5C5499',30)  // 10.0 - 16.0
    Not sure if this is "correct" but it does give me what I wanted, deeper purple for higher than 10 UV index.
    Ah my feeble attempts at pretending to know what I am doing when really I don't :mrgreen:

    Barry
    Barry
    Station Closed (Travelling around Australia)

    User avatar
    laulau
    Posts: 524
    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 9:59 am

    @ Beteljuice,

    Yes the file is utf-8 no bom encoded.
    my problem only occurs with km/h selected in "Winspeed"
    Your original script here http://meteo.laurentmey.fr/betel/basic.php

    P.S.
    the fr section

    Code: Select all

                    'fr' => array(
                        'daily' => 'Journalier', // drop-down table selector
                        'seasonal' => 'Saisonnier', // drop-down table selector
                        'note' => array('Note','Ensemble de donnée incomplet'),
                        'loading' => 'Lecture des données ...',
                        'fail' => 'Erreur donnée !!!',
                        'total' => 'Σ',
                        'avg' => 'Moy',
                        'hi' => 'Max',
                        'lo' => 'Min',
                        'dom' => 'Dom', // 'short' for dominant (wind direction)
                        'season_1' => '<img src="snowflake.png" height="22px" />Hiver', // previous Dec, Jan, Feb
                        'season_2' => '<img src="daffodil.png" height="22px" />Printemps', // Mar, Apr, May
                        'season_3' => '<img src="sun.png" height="22px" />Eté', // Jun, Jul, Aug
                        'season_4' => '<img src="leaf.gif" height="22px" />Automne', // Sep, Oct, Nov
                        'mn' => array('Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sept', 'Oct', 'Nov', 'Déc'),
                        'dy' => array('Dim','Lun','Mar','Mer','Jeu','Ven','Sam'),
                        'compass_headings' => array('N&nbsp;&#x2193;','NE&nbsp;&#x2199;','E&nbsp;&#x2190;','SE&nbsp;&#x2196;','S&nbsp;&#x2191;','SW&nbsp;&#x2197;','W&nbsp;&#x2192;','NW&nbsp;&#x2198;','N&nbsp;&#x2193;'),
                        'maxtemp' => array('Temp max', 'Température maximum'),
                        'mintemp' => array('Temp min', 'Température minimum'),
                        'tdiff' => array('T&deg; Diff', 'T&deg; Différence'),
                        'avgtemp' => array('Temp moy', 'Température moyenne'),
                        'rainfall' => array('Pluie', 'Pluie'),
                        'windspd' => array('Vent', 'Vitesse du vent maximum'),
                        'windgust' => array('Rafale', 'Rafale maximum'),
                        'windrun' => array('Distance', 'Distance parcourue journalière'),
                        'winddir' => array('Direction', 'Direction vent dominant'),
                        'baromax' => array('Baro Max', 'Pression atmosphérique maximum'),
                        'baromin' => array('Baro Min', 'Pression atmosphérique minimum'),
                        'HoursSun' => array('Ensoleillement', 'Durée ensoleillement'),
                        'HighUV' => array('Index UV', 'Index UV')
                    ),
    
    Laurent

    Image

    User avatar
    nitrx
    Posts: 1298
    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 10:34 am

    Thanks for the fix Betel I've to validate some data but I see no selectors in the headingmnue with chrome this is confusing for chromevisitos, and for the windspeed I've some charachters like this 0"> The windspeed and gusts are also too low in m/s.

    Ron

    http://www.apeldoorn.tk/weer/basic.php
    You do not have the required permissions to view the files attached to this post.

    User avatar
    laulau
    Posts: 524
    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 11:11 am

    Changed

    Code: Select all

        if($factor != 1){ // conversion required
            return number_format($value * $factor, $wind_dec, '.' , '');
        } else {
            return number_format($value, $wind_dec, '.' , '');
        }
    to

    Code: Select all

        if($factor != 1){ // conversion required
            return number_format($value * $factor, $wind_dec, '.' , '');
        } else {
            if ($value == '') $value = 0;
    		return number_format($value, $wind_dec, '.' , '');
        }
    and works now for wind!
    The Windspeed column is empty for some old data :oops:
    Laurent

    Image

    User avatar
    nitrx
    Posts: 1298
    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 1:28 pm

    The Dutch (nl) translation module:

    Code: Select all

    'nl' => array(
                        'daily' => 'Dagelijks', // drop-down table selector
                        'seasonal' => 'Seizoenen', // drop-down table selector
                        'note' => array('Let op','dataset is niet compleet.'),
                        'loading' => 'Ophalen van data ...',
                        'fail' => 'Data FOUT !!!',
                        'total' => '&#931;',
                        'avg' => 'Gem',
                        'hi' => 'Max',
                        'lo' => 'Min',
                        'dom' => 'Dom', // 'short' for dominant (wind direction)
                        'season_1' => '<img src="snowflake.png" height="22px" />Winter', // previous Dec, Jan, Feb
                        'season_2' => '<img src="daffodil.png" height="22px" />Lente', // Mar, Apr, May
                        'season_3' => '<img src="sun.png" height="22px" />Zomer', // Jun, Jul, Aug
                        'season_4' => '<img src="leaf.gif" height="22px" />Herfst', // Sep, Oct, Nov
                        'mn' => array('Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
                        'dy' => array('Zon','Maa','Din','Woe','Don','Vrij','Zat'),
                        'compass_headings' => array('N&nbsp;&#x2193;','NO&nbsp;&#x2199;','O&nbsp;&#x2190;','ZO&nbsp;&#x2196;','Z&nbsp;&#x2191;','ZW&nbsp;&#x2197;','W&nbsp;&#x2192;','NW&nbsp;&#x2198;','N&nbsp;&#x2193;'),
                        'maxtemp' => array('Max Temp', 'Maximum Temperatuur'),
                        'mintemp' => array('Min Temp', 'Minimum Temperatuur'),
                        'tdiff' => array('T&deg; Verschil', 'T&deg; Verschil'),
                        'avgtemp' => array('Gem Temp', 'Gemiddelde Temperatuur'),
                        'rainfall' => array('Neerslag', 'Neerslag'),
                        'windspd' => array('Windsnelheid', 'Hoogste Windsnelheid'),
                        'windgust' => array('Windvlaag', 'Hoogste Windvlaag'),
                        'windrun' => array('Wind Run', 'Wind Run'),
                        'winddir' => array('Windrichting', 'Dominante Windrichting'),
                        'baromax' => array('Baro Max', 'Luchtdruk - Max'),
                        'baromin' => array('Baro Min', 'Luchtdruk - Min'),
                        'HoursSun' => array('Zonneschijn', 'Zonuren'),
                        'HighUV' => array('UV Index', 'UV index')
                    ),

    User avatar
    beteljuice
    Posts: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sun 02 Feb 2014 2:09 pm

    @ BCJKiwi

    attempted fix for advisory reporting.

    @ Laurent

    I still can't duplicate what you get >Edit: old link removed<

    Not sure what you mean by "and works now for wind!" - there does seem to be something strange happening when you have 'null' values (which should have been ignored) - it screws up the averages (as 0 [zero] is valid data)

    @ Ron

    I've changed the stylesheet - see if that gives you the drop 'arrow' in chrome.
    Last edited by beteljuice on Tue 18 Feb 2014 4:23 am, edited 1 time in total.
    Image
    ......................Imagine, what you will KNOW tomorrow !

    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 2:24 pm

    Finnish (fi) translation module:

    Code: Select all

                    'fi' => array(
                        'daily' => 'Päivittäin', // drop-down table selector
                        'seasonal' => 'Vuodenajoittain', // drop-down table selector
                        'note' => array('Huom!','Keskeneräinen datatiedosto'),
                        'loading' => 'Hakee tiedostoa ...',
                        'fail' => 'DATAVIRHE !!!',
                        'total' => '&#931;',
                        'avg' => 'Keskim.',
                        'hi' => 'Korkein',
                        'lo' => 'Alin',
                        'dom' => 'Hallitseva', // short for dominant (wind direction)
                        'season_1' => '<img src="snowflake.png" height="22px" />Talvi', // previous Dec, Jan, Feb
                        'season_2' => '<img src="daffodil.png" height="22px" />Kevät', // Mar, Apr, May
                        'season_3' => '<img src="sun.png" height="22px" />Kesä', // Jun, Jul, Aug
                        'season_4' => '<img src="leaf.gif" height="22px" />Syksy', // Sep, Oct, Nov
                        'mn' => array('Tam', 'Hel', 'Maa', 'Huh', 'Tou', 'Kes', 'Hei', 'Elo', 'Syy', 'Lok', 'Mar', 'Jou'),
                        'dy' => array('Su','Ma','Ti','Ke','To','Pe','La'),
                        'compass_headings' => array('POH&nbsp;&#x2193;','KOI&nbsp;&#x2199;','IT&Auml;&nbsp;&#x2190;','KAA&nbsp;&#x2196;','ETE&nbsp;&#x2191;','LOU&nbsp;&#x2197;','L&Auml;N&nbsp;&#x2192;','LUO&nbsp;&#x2198;','POH&nbsp;&#x2193;'),
                        'maxtemp' => array('Korkein lämpö', 'Korkein lämpötila'),
                        'mintemp' => array('Alin lämpö', 'Alin lämpötila'),
                        'tdiff' => array('Lämpötilaero &deg', 'Lämpötilaero &deg'),
                        'avgtemp' => array('Keskim. lämpö', 'Keskimääräinen lämpötila'),
                        'rainfall' => array('Sade', 'Sademäärä'),
                        'windspd' => array('Tuulen nopeus', 'Korkein keskituulen nopeus '),
                        'windgust' => array('Puuska', 'Korkein tuulenpuuska'),
                        'windrun' => array('Tuulen matka', 'Tuulen matka'),
                        'winddir' => array('Tuulen suunta', 'Hallitseva tuulen suunta'),
                        'baromax' => array('Korkein ilmanpaine', 'Korkein Ilmanpaine'),
                        'baromin' => array('Alin ilmanpaine', 'Alin Ilmanpaine'),
                        'HoursSun' => array('Auringonpaiste', 'Auringonpaistetunnit'),
                        'HighUV' => array('UV Index', 'Korkein UV indeksi')
                    ),
    Br,
    Mika
    Image

    User avatar
    jdc
    Posts: 142
    Joined: Tue 19 Jun 2012 8:51 pm
    Weather Station: Davis VP2 : Instromet
    Operating System: Win 10 : Win XP
    Location: Berwick-upon-Tweed, England.
    Contact:

    Re: Yet Another Dayfile Reader (PHP)

    Post by jdc » Sun 02 Feb 2014 2:41 pm

    Trying to add evapotranspiration and just noticed multiplier for DoRain should be 25.4. ;)

    PS Who are Ethel, Bert & Gilliam? :)

    User avatar
    nitrx
    Posts: 1298
    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 2:55 pm

    beteljuice wrote:
    @ Ron

    I've changed the stylesheet - see if that gives you the drop 'arrow' in chrome.
    Works fine now in chrome / ie / ff

    Ron

    User avatar
    nitrx
    Posts: 1298
    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 3:08 pm

    Question how are the averages calculated ?

    Month = sum daily averages dividedd by total days of the month ?

    Season = sum 3 months of the season divided by 3 ?

    Ron

    Post Reply