Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.0.0 build 3050 - 1 May 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
beteljuice
Posts: 2710
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 » Thu 08 Aug 2019 10:51 pm

@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: 192
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Yet Another Dayfile Reader (PHP)

Post by Phil23 » Fri 09 Aug 2019 9:18 pm

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.
Image

User avatar
beteljuice
Posts: 2710
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 » Fri 09 Aug 2019 9:46 pm

... 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 !

meteosangonera
Posts: 8
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera » Fri 16 Aug 2019 5:04 pm

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: 2710
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 » 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.

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 !

meteosangonera
Posts: 8
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera » Sat 17 Aug 2019 6:05 am

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: 69
Joined: Tue 24 Nov 2015 11:30 pm
Weather Station: Fine Offset
Operating System: Windows 7; Linux
Location: Switzerland

Re: Yet Another Dayfile Reader (PHP)

Post by ExperiMentor » 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'

User avatar
beteljuice
Posts: 2710
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 » 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)
Image
......................Imagine, what you will KNOW tomorrow !

meteosangonera
Posts: 8
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera » Sun 18 Aug 2019 6:27 am

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.

meteosangonera
Posts: 8
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera » Sun 18 Aug 2019 6:30 am

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: 2710
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 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 !
Image
......................Imagine, what you will KNOW tomorrow !

meteosangonera
Posts: 8
Joined: Thu 07 Jun 2018 2:17 pm
Weather Station: Davis
Operating System: Windows 10
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by meteosangonera » Sun 18 Aug 2019 2:16 pm

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: 2710
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 18 Aug 2019 10:29 pm

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 !

Post Reply