Additions to website

Several additions to the website in the latest update (v1.12.0) has been made with several new graphs now available. Various other changes have been made and the seasonal weather summary for the summer of 2020 to 2021 has been published in Reviews.

The new graphs available are as the following:

  • Website Analytics: 2 new graphs of cumulative number of visits and page views of all visitors (Cumulative Visits) and return visitors (Cumulative Return Visits)
  • Historic Graphs: New graphs for annual thermal energy (shown under Thermal). This is shown for Growing Degree Days and Temperature Sum that utilises daily temperatures compared to base temperatures to track plant growth and seasonal progress
  • Heatmap charts: This is a new page that shows our logged historical data for the past 10 years by hour and day across a given year for a selected metric
  • Wind Rose charts: This is another new page that charts the distribution of wind speed and wind direction for various periods. The time periods include recent data and any year, month or all data during the last 10 years

To provide further information about how the new graphs have been added, that php scripts are used to run queries against the database and insert that data into JSON format arrays in a format that the Highcharts graphs can use. The link to the js file containing the Javascript code for the highcharts can be viewed from page source code, such as analyticsSQL.js for the Website Analytics graphs. From the Javascript code the code of the php scripts used as the data input can be accessed by appending a ?view=sce to the url.

Adding the new website analytics graphs as mentioned above came about because it is of interest to plot the month to month trend in the visitor numbers. From this it can clearly seen that the trend have been generally linear even though there are variations in individual months. The direct links to the php scripts are as per the following: Cumulative Visits and Cumulative Return Visits

Explaining the Growing Degree Days (GDD) in more detail this provides an easy to use simple indication of crop or plant development over a period of time as result of the accumulation of heat. Plant growth is often dependent on the amount of heat experienced over time. So to quantify the amount of thermal energy available over time, GDD is a cumulative total of daily temperatures that can give an indication of how the season/s is progressing for plant growth and provide a future indication to when a required amount of GDD would be reached.

Note that other factors are not included such time integrated warmth over each day, transpiration, soil moisture and rainfall. The daily GDD contribution is calculated as the difference of the daily average temperature (average of minimum and maximum temperatures) for each day from base temperatures. The daily GDD is set to zero if the average temperature is below the base temperature (not possible in our climate). Daily maximum temperatures over 30 C are capped at 30 C as many plants don’t grow as quickly in hotter weather.

The temperature sum is similar and provides an indication of the accumulative effect of the thermal energy available over a period of time based on the temperature. However that while the Growing Degree Days (GDD) provides an indication for plant growth, Temperature Sum provides a more general gauge on the progress of the total amount of coolth or warmth of the season/s. Similar to the GDD base temperatures are also employed.

The temperature for each day for the temperature sum is calculated as the difference of the daily average temperature (average of minimum and maximum temperatures) for each day from base temperatures. The daily temperatures used for sum that are below the base temperature do reduce the cumulative temperature sum, in contrast to this not affecting the cumulative temperature in GDDs.

The php scripts employed for the GDD and temperature sum are parameterised meaning that values are appended to the end of the url to control the output received in the query. This allows for the base temperatures and starting month to be defined as well as the capping of temperatures at 30 C in GDD or the metric used in the temperature sum. The header in the php script explains in more detail about the parameters the script accepts. The temperature sum is show for daily average, minimum and maximum temperatures (metric used is set in the url parameter) because there are differences between these that show the coolness and warmness of the season in different ways depending on the base temperatures chosen. The direct link to the php scripts is the following: Growing Degree Days and Temperature Sum.

And if of interest this is the main SQL query for the annual Growing Degree Days for each year as contained in the php script which uses both SQL and php variables.

And this is the main SQL query for annual temperature sum for each year as contained in the php script which has both SQL and php variables.

Let us know if you find this content interesting or if you have any questions or comments. I hope that you find the new data helpful or of interest.

UV radiation data

The website have been updated (v1.11.0) with new data that is now available on multiple pages to incorporate Ultraviolet (UV) radiation data following the start of recording this data from 21 March 2021. This addition is part of changes to measure solar radiation and air quality and to switch to a Weatherlink Live receiving unit between 19 and 26 December 2020.

The following pages have been updated with additional data:

  • The home page: the UV Index have been added to the real time updates including the UV Index exposure categories in the international colours with sun protection suggestions when hovering over the UV Index category
  •  Gauges: A gauge for UV Index was added
  •  Recent Graphs, Past Months Graphs and Historical Graphs: updated with new graphs containing UV Index (with banding for the exposure categories) and UV Dose data, as well as adding the UV Index to the existing Solar radiation graphs
  •  Today and Yesterday: Extremes and total for UV Index and UV Dose added
  •  This Month and Year: Extremes for UV Index added
  •  Annual Data Summary: Data for UV Index added
  • All-Time Records: Extremes for UV Index added
  •  Top 10 Records: UV Index records added
  •  Recent Extremes Since: UV Index extremes added for today and yesterday
  • About: updated with new information regarding the addition of the UV sensor that have been installed
  •  System Status: Reworked to align with the system changes and to provide additional system information now available with this change
  •  Glossary: Updated with additional terms for UV Index and UV Dose, including details of the formula used to calculate the UV Dose.

 Other changes made with this update include:

  • The database script that updates the Website Analytics page with current rainfall data by website visitors is now automated at the start of each month. This is a very expensive series of calculations that is only updated monthly.
  • On the Website Analytics page an issue fixed with the showing values greater than 90% on the Daily Rain by Visits graph
  • Fix an issue with the “New records in last 10 days” on the home page that didn’t show the month for a new monthly rain rate record
  • Added a note of discouragement to the link page about not requesting links to be added for commerical or spam purposes.

The UV Dose was added as to quantify the amount of UV radiation received at this location for each hour and over the course of day. This is because it is known that it is both the magnitude and length of time that determines how much radiation exposure is being received for sun protection purposes. This is calculated for each hour and shown on several pages. Whilst the Glossary page provides more information about this measure and how it calculated, for those interested below is the SQL statement to calculate the UV Dose from the real-time data for the Recent Graphs page.

And similarly the SQL statement for UV Dose on the Past Months Graphs page:

Feel free to let us know of your thoughts or suggestions regarding these additions.

New air quality statistics

The air quality data we recently began to measure has been expanded to include statistics for this month, this year and all-time.  This data is now available on the this month and year and all-time record pages.

In the short period that we have been measuring air quality the air is exceptionally clean. For the vast majority of the time the particulates and air quality index values have been extremely low (good) and have been elevated to a slight degree only for fairly short periods of time.

To include these new statistics changes were required to be made to our database. Since the recording of air quality began from 26 December 2020, a routine is ran at the start of each day to fetch the data from the previous day to insert a new row into a database table for that day. However generally only the averages and maximums were shown, without the earliest time of the occurrence. With these improvements now the averages, minimum and maximums are measured for each day along with the time of minimums and maximums.

However, it should noted that these additions began from 7 February 2021, because we only retain the real-time data for 7 days (for data storage reasons). Therefore the time of occurrence will not be shown for statistics before this date. Also we collecting a vast range of daily parameters, most of which haven’t been published to a great deal on the web site, but is being collected for completeness and for future analysis.

To provide a bit more information about how this works a MySQL database procedure (as shown below) is scheduled to run at the start of each day to insert the previous day data into a table of daily air quality averages and extremes. This uses the ROW_NUMBER window function to calculate the earliest time for each individual minimum and maximum for each day. A query for each of one of these calculations are then joined to a query that essentially merges these calculations into one table. Because these calculations are rather expensive a variable retrieves the latest date of data already inserted into the data to limit the quantity of data that is calculated to only the data not already captured in the daily table.

These queries are both performed on the real-time table (every 10 seconds) and an 5 minute interval logged data table, with the results inserted into temporary tables. These two temporary tables are then used to determine the greatest value of each of these data sources to insert the data for each column of data. This is so that the data is suitably captured due any possible network outages that may affect the currency of data. The SQL COALESCE function is used to return the first non- null value from these data sources, with preference provided to the Real-time table.

A PHP script contains SQL queries that retrieve the necessary information from this table and are assigns to variables when the web page is visited. This allows for these statistics to be shown on the web page and is the same principle as several other statistics on these and other pages. The SQL queries are fairly simple because the daily air quality data already shows all the required summarised information for each day.

Solar and air quality data

New data is now available on multiple pages to incorporate solar radiation, sunshine and air quality following the start of recording these parameters from 26 December 2020. These sensor were installed along with the change to using a Weatherlink Live receiving unit between 19 and 22 December 2020, which were then tested for compatibility with our processes and existing data.

The following pages have been updated with additional data:

  • The home page: the solar and air quality data have been added to the real time updates on the home page, sunshine/ night-time bands have been added to the real-time graph, the station forecast have been removed and a Bureau of Meteorology forecast added
  •  Gauges: A gauge for solar radiation was added
  •  Today and Yesterday: Averages, Totals and Extremes for Solar, Insolation, Sunshine and Air Quality added
  •  System Status: Reworked to align with the system changes and to provide additional system information now available with this change
  •  Glossary: Updated with additional terms of Air Quality, Insolation, Solar Radiation and Sunshine.

 A routine now runs at the start of each day to collate the air quality data into an additional daily database table used in the Historical graphs. The Realtime database table was altered to include air quality data. A monthly air quality database is also populated with data each 5 minutes.

A combination of our regular data updating on the website and these Realtime and Monthly database tables are used to update the tables and graphs on the website. The Realtime and Monthly database tables are also used as in the input to update the daily air quality database table.

Coming soon will be the addition of UV data. Also air quality data for the this month, this year and all-time records is also planned. Additional data will need to added to the daily database table in order to show that data along with the date and time of the occurrences.

Under progress is the calculation of daily potential evapotranspiration and possibly evaporation now that we are measuring solar radiation. Due to limitations with the system I am using it appears these will have to be calculated, rather than supplied by the weather station directly. These are rather complex multi-step calculations, so considerations are being made with the practicalities of that and what data will be shown from that on the website.

Website analytics

A new page is now available that has been in development lately of a different nature to the existing content on the website. We use the privacy friendly open source website analytics platform Matomo that is hosted on-premises where we fully own the data that allows us to understand the usage and interest in this service we provide.

This website analytics data have been used to determine whether there is a correlation between the visits are made to the website compared to amount of the rainfall at the time and to test whether visitor activity is stronger during wetter weather. From this it have been discovered that at this time that while a lot of visits are made when there is no rainfall, when expressed in percentage terms that there is a general trend in more interest in the website during wetter weather, whilst visits across the range of rainfall totals are very consistent.

This information of visits by rainfall have been published on the new page as four charts using this information calculated from our databases. In addition to this, more standard summarised data over time of the number of visits, the type of devices used and the visits made by returning and frequently returning visitors. On that page are explanations of the definitions relating to this data and also there are key metric for various periods to provide a quick summary.

Thank you to all those who have shown an interest in this website and the many who have come back to this website many times. I have been quite surprised at the strong visitor activity that has occurred and there is clearly an interest on local real-time weather data. This website is in continued development with completed new works announced on this blog in addition to updates to the website that are mentioned on our Website Info page.

The below information is provided to share how this page is put together at this time for anyone who want to have more understanding of this. Both the analytics data and weather data are stored in MySQL databases, which are both used to create four database tables containing the data for the four graphs for the visits by rainfall. These calculations use table joins and appropriate aggregations to produce the data to allow for a fair comparison. But because these are quite complex calculations the database queries are not executed when a graph is viewed as retrieving the current data will add significant time to load the graph.

So given that this data doesn’t change too quickly, a SQL procedure is executed once a month to update the data for when someone visits the page. The SQL code used in that procedure is similar to the below example. The methodology used is that a table is created to calculate the amount of rainfall in the previous 24 hours for each hour during the past year, of which this data is not readily available in the database. This is derived by first calculating the rain for each hour, then the cumulative rainfall during the last year for each hour and then calculate the amount of rainfall for each hour compared to the same time in the previous day.

Once we have that data then table joins are used to merge the analytics data to this rainfall data for each of the four tables. Finally at the end the rainfall data is deleted, as the data is no longer needed.