Page 1 of 1

Annual Extremes - Year-by-year

Posted: Fri 28 Feb 2014 7:27 am
by tjaliwalpa
I've decided to include annual records or extremes on my website. My service provider web server that I use does not use PHP. I know there are webtags for extremes during the current year, but I can see anyway of extracting extremes using webtags for each year in the same way that the monthlyrecord.htm does using the ByMonth webtags with the mon=? In the webtag.

It would be great if the tags such as <#YearTempH> had a variable similar to the ByMonth tags.

Am I barking up the wrong tree? Is there another solution? I could of course take the dayfile and put it in Excel and extract the extremes, but I was looking at a method that could be used on any Cumulus website and would not need the data to be hard coded into the webpage.

I want to produce a records page that is similar to the monthlyrecord page. I've started it but have come to a halt.

http://members.aussiebroadband.com.au/m ... record.htm

Re: Annual Extremes - Year-by-year

Posted: Fri 28 Feb 2014 7:53 am
by mcrossley
No simple way that I can think of without PHP (and a database would make it even easier). Without any processing on your server you would have to automate on your weather computer (you could install PHP on there, which would mke the code largely reusable by others) and (re-)generate the page once a day after the end of day processing.

Re: Annual Extremes - Year-by-year

Posted: Fri 28 Feb 2014 8:28 am
by steve
tjaliwalpa wrote:It would be great if the tags such as <#YearTempH> had a variable similar to the ByMonth tags.
Yes, I agree, but at the moment that's not easy to do, as the data isn't stored anywhere. The code for the web tags in Cumulus would have to trawl through dayfile.txt for each web tag, and that's very inefficient, particularly as the data for previous years never changes. At some point I will look into storing the data in Cumulus in some form that it's easier to get into web tags, an SQL database or simply a 'flat' table.

I think that as the data for previous years does never change, the simplest, most practical solution at the moment is to do as you suggest and hard code the data - you would only have to do it once.

Re: Annual Extremes - Year-by-year

Posted: Fri 28 Feb 2014 9:13 am
by tjaliwalpa
Thanks Steve and mcrossley,

I'm not familiar with PHP so will probably not venture there yet.

Steve, as you suggest and as I first thought, hard coding the data is probably easiest and is only a once off task for me. All time data is easily done with Cumulus web tags as is the current year. It's just a matter of inserting the previous year's data after New Year as the current year tags will continue.

On another slightly related topic, I changed the tags in the monthlyrecord.htm so that the current month comes up as default in the table, including the label at the top of the table. The default is for January to display. I've just used the standard ByMonth... tags without a mon=?

Re: Annual Extremes - Year-by-year

Posted: Fri 28 Feb 2014 9:26 am
by steve
tjaliwalpa wrote:On another slightly related topic, I changed the tags in the monthlyrecord.htm so that the current month comes up as default in the table, including the label at the top of the table. The default is for January to display. I've just used the standard ByMonth... tags without a mon=?
Yes, the default is to use the current month.

An alternative method, just requiring one extra line, would be as described in this recent thread: https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=11508

Re: Annual Extremes - Year-by-year

Posted: Sun 02 Mar 2014 8:13 am
by tjaliwalpa
I've now completed the two pages on my web site for monthly extremes (nothing new here) and for yearly extremes (an adaptation of records.htm), showing by default All Time extremes and year by year extremes. The year by year data is hard coded but the All Time and current year use cumulus <#webtags>. It will require a little work every New Year but I'm happy with the result.

http://members.aussiebroadband.com.au/m ... record.htm
http://members.aussiebroadband.com.au/m ... record.htm

Re: Annual Extremes - Year-by-year

Posted: Sun 02 Mar 2014 8:19 am
by hills
Nice work Bob! :clap: