Page 2 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 12:17 am
by laulau
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: )

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 1:38 am
by beteljuice
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 2:24 am
by nossis
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 2:59 am
by BCJKiwi
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 3:41 am
by beteljuice
@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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 6:20 am
by nossis
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 9:59 am
by laulau
@ 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')
                ),

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 10:34 am
by nitrx
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 11:11 am
by laulau
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:

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 1:28 pm
by nitrx
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')
                ),

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 2:09 pm
by beteljuice
@ 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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 2:24 pm
by mikkimii
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')
                ),

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 2:41 pm
by jdc
Trying to add evapotranspiration and just noticed multiplier for DoRain should be 25.4. ;)

PS Who are Ethel, Bert & Gilliam? :)

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 2:55 pm
by nitrx
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 02 Feb 2014 3:08 pm
by nitrx
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