Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Yet Another Dayfile Reader (PHP)

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

Moderator: daj

User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@phil23

First of all, be sure of what it is you actually want.
In your post you suggest that the min / max was shown in the Seasonal table.

NO - that is why they are labled HI / Lo
eg. Temp Max > lo is the lowest MAXIMUM temperature and so on ...

I get the impression that you would like to add to the 'year' table true Max / Min (Avg ?) (to be displayed if either Max OR Min is requested for a specified dataset)

It would of course be possible to create new tables / buttons for just that info.

Either way where Max / Min values are separate data this involves using the 'computed' example as you want work with TWO different sets of data (for whatever specific data 'type').

Where a dataset only has one possible value, then you need to calculate the max / min values.

.. although for each dataset the code / reasoning is already there somewhere.
For most of the data 'types' you've just posted the Min is always going to be 0 (zero)
Image
......................Imagine, what you will KNOW tomorrow !
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

beteljuice wrote: Thu 08 Aug 2019 10:51 pm @phil23

First of all, be sure of what it is you actually want.....

I get the impression that you would like to add to the 'year' table true Max / Min (Avg ?)
(to be displayed if either Max OR Min is requested for a specified dataset)
I do tend to think out loud & then waffle on a bit....
Then put it in posts before completely engaging my brain.

Best explaination is on the daily minimums table for example,
after the yearly averages block at the bottom.

A similar table that list the lowest temp for each month/year.
For say the Maximums table it would show the highest for each month/year.

Anyway I do credit myself with have the ability to have stupid ideas at times & after consideration realise I should have given myself a slap on the back of the head....

Cheers.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

... after the yearly averages block at the bottom.

A similar table that list the lowest temp for each month/year.
Thank you for clarifying.

Yes that is feasible - the values are easily gleaned from the arrays already constructed to work out the averages (and don't forget the 'yearly' table is an option).
If you decide that eg. temp (Min or Max) extremes are a 'must have' then while the yearly averages are being constructed you would at the same time create / build your extremes 'table' as a separate $var.
Then .. stitch it in near the end of $tableLayout

I'm not sure how it would 'sit' in a page with many years of data, and of course those extremes are shown in the Seasonal view ...

.. but on your site with your data you can do what you want ;)
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
meteosangonera
Posts: 52
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera »

I have a serie of data from 1940 to 2019, the date field has the following format: "DD/MM/YYYY"

I can make two tables, the first from 1942 to 1999 and another from 2000 to 2019, but the interesting thing would be to have all the data in the same table.

Can you help me?

Thank you.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

What has this to do with dayfile.txt ?

If your data can be converted to dayfile.txt format - then it should work.

Edit: (after I've had some medication) Hmm ... not properly, I see your problem.
Last edited by beteljuice on Sat 17 Aug 2019 10:05 pm, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
meteosangonera
Posts: 52
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera »

beteljuice wrote: Fri 16 Aug 2019 9:18 pm What has this to do with dayfile.txt ?

If your data can be converted to dayfile.txt format - then it should work.
I can convert all the data, except the date field, due to the data begins in 1940 and not in 2000.

Therefore I need the date field to have the format DD/MM/YYYY instead of DD/MM/YY in order to make a difference between the 1900s and 2000s.

For example, in 2040, I will have the data repeated as for both 1940 and 2040 the first row will begin: 01/01/40.
ExperiMentor
Posts: 214
Joined: Tue 24 Nov 2015 11:30 pm
Weather Station: Fine Offset & Davis Vantage Vue
Operating System: Windows 10; Raspbian Buster
Location: Switzerland

Re: Yet Another Dayfile Reader (PHP)

Post by ExperiMentor »

If what you want is everything in one file, a pretty awful but quick and dirty fix would be to add 60 years onto all your dates so that 1940 displays as 2000 and 2010 as 2070.

Alternatively, you can get them in one file with the correct last 2 digits (but in the wrong order) if you left-truncate the century from the year to delete the '19'. Then you'd have 2000-2019 appearing as dd-mm-00 to dd-mm-19, and 1940-1999 appearing as dd-mm-40 to dd-mm-99.

As I said - quick - dirty - functional. Depends if that's good enough!

Excel can do either the 'add 60 years' or 'left truncate the century from the year'
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Therefore I need the date field to have the format DD/MM/YYYY instead of DD/MM/YY in order to make a difference between the 1900s and 2000s.

For example, in 2040, I will have the data repeated as for both 1940 and 2040 the first row will begin: 01/01/40.
Ah yes - I forgot about Cumulus just doing the last two year digits, and of course you want ongoing updates to dayfile.txt.

I will ponder at my leisure .... (Other irons in the fire ATM)
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
meteosangonera
Posts: 52
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera »

ExperiMentor wrote: Sat 17 Aug 2019 9:48 pm If what you want is everything in one file, a pretty awful but quick and dirty fix would be to add 60 years onto all your dates so that 1940 displays as 2000 and 2010 as 2070.

Alternatively, you can get them in one file with the correct last 2 digits (but in the wrong order) if you left-truncate the century from the year to delete the '19'. Then you'd have 2000-2019 appearing as dd-mm-00 to dd-mm-19, and 1940-1999 appearing as dd-mm-40 to dd-mm-99.

As I said - quick - dirty - functional. Depends if that's good enough!

Excel can do either the 'add 60 years' or 'left truncate the century from the year'
Thanks for you idea, but I think it would be confusing for the users of my website. For the time being I will make two different tables, one until 1999 and another from 2000, Waiting to find another solution.
User avatar
meteosangonera
Posts: 52
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera »

beteljuice wrote: Sat 17 Aug 2019 10:03 pm
Therefore I need the date field to have the format DD/MM/YYYY instead of DD/MM/YY in order to make a difference between the 1900s and 2000s.

For example, in 2040, I will have the data repeated as for both 1940 and 2040 the first row will begin: 01/01/40.
Ah yes - I forgot about Cumulus just doing the last two year digits, and of course you want ongoing updates to dayfile.txt.

I will ponder at my leisure .... (Other irons in the fire ATM)
For the time being I will make two different tables, one until 1999 and another from 2000, Waiting to find another solution.

Can I adapt your script so that it does not add "20" to the date but "19"?

Thanks
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Can I adapt your script so that it does not add "20" to the date but "19"?
... but of course - It's yours to tweak as you see fit. (might be better to remove the 'add' and '20' checks altogether and keep your full year)

There are about 15 entries to change, starting at approx. line #1807

... but I may have a better way in mind, ...... when I have the time !
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
meteosangonera
Posts: 52
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera »

beteljuice wrote: Sun 18 Aug 2019 9:27 am
Can I adapt your script so that it does not add "20" to the date but "19"?
... but of course - It's yours to tweak as you see fit. (might be better to remove the 'add' and '20' checks altogether and keep your full year)

There are about 15 entries to change, starting at approx. line #1807

... but I may have a better way in mind, ...... when I have the time !
Here you can see the result http://www.meteosangonera.es/datosdiariosalcantarilla/

I think it looked good. I'll be keeping an eye out for possible script updates.

You do a great job. I wish I knew how to do this kind of thing.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Works well :clap:

Second thoughts, probably better to keep the 1900 / 2000 separate as the 'yearly' parts of the table would be very long.
Image
......................Imagine, what you will KNOW tomorrow !
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 »

beteljuice wrote: Sun 18 Aug 2019 10:29 pm On Mon Aug 19, 2019 8:29 am

Works well :clap:
You must be getting bored?

Maybe someone needs to suggest a new twist to this thread to keep you occupied! :shock:
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@phil

the beteljuice is always tweaking / repairing / creating something - mostly because it's 'there' and sometimes because it just ain't quite right.

(one of my In Progress 'put right / improve' projects) one of many
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply