Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 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

Rolling Weekly Data - Displaying data on website

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

Moderator: daj

Mapantz
Posts: 1772
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by Mapantz »

Thunderstorm watch tonight, for you Andy. You look to be in a good spot!

Glad you've got the script all working!
Image
griffo42
Posts: 224
Joined: Thu 10 Dec 2015 6:41 am
Weather Station: Davis Vantage Pro2
Operating System: Win 11 Home
Location: Brisbane, Queensland, Australia
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by griffo42 »

Here are 2 screenshots which when compared with each other indicate that I have a problem.

This one is of my site home page:
Screenshot 2022-06-03 163322.png
and this one of my 7 day rolling data:
Screenshot 2022-06-03 163217.png
The problem as can be seen is that the 7 day rolling data is not updating in relation to the last 6 days.

Any suggestions, please as to how to fix this.

Keith
You do not have the required permissions to view the files attached to this post.
Keith
Davis Vantage Pro2 Model #6152AU - CumulusMX - Win11 - Saratoga/CUMX Default Scripts
https://www.kstwx.net/index.php
https://www.kstwx.net/cumx/index.html
Image
griffo42
Posts: 224
Joined: Thu 10 Dec 2015 6:41 am
Weather Station: Davis Vantage Pro2
Operating System: Win 11 Home
Location: Brisbane, Queensland, Australia
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by griffo42 »

All fixed. Problem was MySQL database not being updated.

Keith
Keith
Davis Vantage Pro2 Model #6152AU - CumulusMX - Win11 - Saratoga/CUMX Default Scripts
https://www.kstwx.net/index.php
https://www.kstwx.net/cumx/index.html
Image
AndyKF650
Posts: 701
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv4 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by AndyKF650 »

I set this interesting web display to work a couple of months ago and on the whole I am pleased with the result.

One issue I have is the weekly average and hence the prior week average of wind direction, the core calculation for these is a straight sum of the daily wind direction in degrees and divide by 7. This will work for "ordinary numbers" but for a direction the result is incorrect, I suspect that the direction would need to be converted to a vector then summed and divided by 7 and then converted to a coordinate.

To save me reinventing the wheel, has any one worked on this issue and come up with a solution?
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Rolling Weekly Data - Displaying data on website

Post by sfws »

Point one - you don't average wind direction without compensating for wind speed at that direction, i.e. the input directions are weighted by the associated wind run at each direction.

You obviously did not try a simple web search, as in first hit reported I saw an answer at https://www.scadacore.com/2014/12/19/av ... ind-speed/.
I'm pretty sure that describes how Cumulus calculates the dominant direction it reports, and a search of the forum would confirm that, but I must go back to my decorating.
AndyKF650
Posts: 701
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv4 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by AndyKF650 »

Thanks @swfs for your response and without being too brusque, Yes, I did do a simple web search but obviously did not find the answer you propose.

As suggested more research is required.

I hope your decorating goes well.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Rolling Weekly Data - Displaying data on website

Post by sfws »

AndyKF650 wrote: Thu 11 Aug 2022 1:27 pm I did do a simple web search but obviously did not find the answer
Using the most popular search engine probably benefits the provider more than the searcher.
I used a less well known search engine and quickly got an answer to "calculate average wind direction".
AndyKF650 wrote: Thu 11 Aug 2022 1:27 pm I hope your decorating goes well.
Ta, I'm repainting woodwork indoors using a proper undercoat followed by top coat trade paint system, and I'm very happy with yesterday's progress.
Unlike last January when I employed a decorating contractor who used a single coat approach, and the result looked terrible!
With the heat, I only do weeding etc. outdoors very early morning, and spend rest of each day progressing indoor chores.
User avatar
HansR
Posts: 5831
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by HansR »

sfws wrote: Thu 11 Aug 2022 1:11 pm Point one - you don't average wind direction without compensating for wind speed at that direction, i.e. the input directions are weighted by the associated wind run at each direction.

You obviously did not try a simple web search, as in first hit reported I saw an answer at https://www.scadacore.com/2014/12/19/av ... ind-speed/.
I'm pretty sure that describes how Cumulus calculates the dominant direction it reports, and a search of the forum would confirm that, but I must go back to my decorating.
I understand what mathematically is being done here but I fail to understand why CMX should use this method.

I gave it some thought over the past days and it still surprises me why average windspeed in the context of CMX (amateur weather enthousiasts in general) needs to be calculated as a Vector Average. I would argue the Scalar Average is sufficient and I seriously doubt CMX calculates the Vector Average. Could you say something about this @mcrossley?

Please check out this Copernicus Marine Services page (from the Copernicus Marine Services Help center, part of Copernicus EU Eyes on the World ).

And @sfws , I think you should be careful bringing such complexity into a relatively simple discussion. I think it is misplaced to suggest Vector Average for wind and direction is common practice where the result can be very different from what an unmoving observer at his home thinks he felt during the day. Remember KISS.

Cheers,
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
HansR
Posts: 5831
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by HansR »

And @Andy, for averaging the direction you can use the scalar average as well, you just need to take care with the northerly winds where degrees may go from 350 to 10 and then lead to an obviously wrong average of 355.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by mcrossley »

For the dominant wind direction Cumulus uses a vector calculation.
User avatar
HansR
Posts: 5831
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by HansR »

mcrossley wrote: Sun 14 Aug 2022 3:36 pm For the dominant wind direction Cumulus uses a vector calculation.
That is a somewhat cryptic statement.

I assume you point to the calculation in the function in DoWind (WeatherStation.cs).
When I look at it I can only see a straight forward scalar Windspeed average (you don't mention it so I assume you agree) and a somewhat complex calculation which uses a decomposition of the wind direction in x and y components which I assume you point to as vector calculation (also because the variable naming does so). This decomposition is then used to calculate the average of the direction over all samples. Finally the averaged vector representation of the direction is converted back to degrees.

I would like to emphasize that this is not the vector calculation @sfws hinted at when looking at the document he links to and reading his line:
sfws wrote: Thu 11 Aug 2022 1:11 pm [...]you don't average wind direction without compensating for wind speed at that direction, i.e. the input directions are weighted by the associated wind run at each direction.
CMX is not interested in air mass displacements so the speed average is simply a scalar average (as CMX indeed does).

Direction is not weighed with wind speed. That is an erroneous concept. The direction 'vector'-calculation which is then used is only to avoid the issues around 360 degrees.

It may have to do with some misunderstanding somewhere, but using a vector calculation where wind speed and direction are combined (possibly leading to a net zero result) is not done in this CMX/DoWind function. I think the statement of @mcrossley agrees there and that of @sfws conflicts.

Although for the direction some vector decomposition is used, it is in result a scalar average, just avoiding the 360/0 pitfall. The definitions for the scalar and vector calculations as in the Copernicus doc are - at least for me - clarifying.

Hope I did not obfuscate this any further :)
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
AndyKF650
Posts: 701
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv4 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by AndyKF650 »

Well my original post has generated a lot of thoughts and research.
My original idea was to find a simple way of getting the average of 7 days wind direction values to fit into my rolling data chart.
I am just not sure how to proceed since most of my wind directions are in the northern quadrant and hece fall clearly into the problem area.
I have tried working out the vector solutions but perhaps my lack of maths skills seems to let me down
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by mcrossley »

HansR wrote: Sun 14 Aug 2022 4:56 pm
mcrossley wrote: Sun 14 Aug 2022 3:36 pm For the dominant wind direction Cumulus uses a vector calculation.
That is a somewhat cryptic statement.

I assume you point to the calculation in the function in DoWind (WeatherStation.cs).
When I look at it I can only see a straight forward scalar Windspeed average (you don't mention it so I assume you agree) and a somewhat complex calculation which uses a decomposition of the wind direction in x and y components which I assume you point to as vector calculation (also because the variable naming does so). This decomposition is then used to calculate the average of the direction over all samples. Finally the averaged vector representation of the direction is converted back to degrees.
Well it's a vector as I understand it, averaging each direction and speed (a vector) in the calculation.
See CalculateDominantWindBearing()
I haven't had time to study the link @sfws provided yet.
User avatar
HansR
Posts: 5831
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: Rolling Weekly Data - Displaying data on website

Post by HansR »

mcrossley wrote: Sun 14 Aug 2022 8:41 pm Well it's a vector as I understand it, averaging each direction and speed (a vector) in the calculation.
Afaics it does not average the speed as a vector.
mcrossley wrote: Sun 14 Aug 2022 8:41 pm See CalculateDominantWindBearing()
I haven't had time to study the link @sfws provided yet.
OK, it's complex. It is not clear to me where the value of CalculateDominantWindBearing() is presented in CMX, but I assume that is the value presented on the interface in the gauges background colour (not the needles which give the current and the 10 min average).

So, the DoWind() calculates the average speed and average bearing using effectively just a scalar for both entities.

The CalculateDominantWindBearing(), calculates the windspeed for the day (at least I think it does) and to do so it decomposes the average windspeed just calculated into x and y. And now comes the trick of the wind dominance: if we have a 10 minute average wind from the north with 20 m/s and after that we have a 10 minute average wind from the east with 5 m/s , the dominance of the wind is said by CMX to be more north than east and it calculates that by multiplying by the two directions by its speed. The decomposition in X and Y components treats only the direction as a vector and the speed as a weight. In that sense @sfws is correct.

But the crux in understanding here is the fact that this is only done in the CalculateDominantWindBearing() which is per day (or a 24 hr running average, that is not clear to me). The scalar averages are stored in the dayfile and so is the dominant windspeed. Again, the average direction is calculated with vector decomposition but without weight of the wind.

And the difference lies in the terms scalar and vector averages (for DoWind and CalculateDominantWindBearing respectively). I quote the Copernicus article:
  • The scalar average is the mean of the wind magnitudes (speed), not taking into account the wind direction. For example, the scalar average of a southerly and a northerly wind of 5 m s^-1 results in a mean wind speed of 5 m s^-1.
  • The vector average takes into account the wind direction and is equal to or smaller than the scalar average. The vector average of a southerly and a northerly wind of 5 m s^-1 gives a mean wind speed of 0 m s^-1 because there is no resultant wind_speed.
The two functions we are discussing here are different and have different functions in CMX.
The speed weighed vector average direction (the dominant direction) is only used in the gauges afaics and is stored in the dayfile in field 40.
There is no calculation nor storage of a vector calculation for wind speed average.

Using the true vector average for windspeed as in the article linked by @sfws could possibly lead to zero wind speed - yes, also in averaging period of 10 minutes - where they only would be opposite. That would be useful if airmass displacement would be needed (like in prediction software I assume). That is not the case in CMX. As such, I think this reference is not correct (and confusing).

Again, hoping I made my point clear enough.

@Andy: I will come back to this (in PM) when there is (enough) agreement and understanding on the issue here, also from my confused side.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Rolling Weekly Data - Displaying data on website

Post by sfws »

@HansR

AndyK's post refers to his Dominant wind direction line on his rolling data report, asking for pointer towards calculation that he could use to show something in 7-day average column and therefore the subsequent trend column. All data for that report is taken from the daily summary database table. That sets a very limited context.

My reply was written for that same very limited context. My previous posts say what search I used and what result I got first. I did not waste my time reading the whole linked article, simply checked it had some relevant details that could help Andy fill in his empty table cell.

I suggested that somewhere in forum there would be a post saying how Cumulus did it, now found at viewtopic.php?p=111741#p111741. Andy can now decide between use of the discussion in the article I linked or use of the bare bones in Steve's post. Before you say that refers to Steve's original beta Cumulus MX, it does, but I doubt if "dominant wind direction" calculation has been changed.

In several posts in this thread you seem to be conducting a campaign against me. Resist that temptation to launch personal attacks, also resist the making of interpretations outside context of individual posts! Only your posts discuss wind speed averaging.
Post Reply