Hi everyone
Thanks for all your help and comments on this task. Obviously what I thought was a simple task of just a simple average was a way under estimate, scalar averaging just does not work.
This left vector averaging which was something I was completely unused to. The degree values are converted into radians, and I worked out the u East and u North components with sin and cos functions of each data point, and averaged the results. This result is then run through the atan2 function and converted back to radians.
The above calculation then was turned into php instruction to get the final result as seem on my web site. For those who are interested the final php code is attached.
Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.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
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.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
Moderator: daj
-
- Posts: 722
- 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
You do not have the required permissions to view the files attached to this post.
- mcrossley
- Posts: 12903
- 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
Hi Andy, that is not quite how CMX does it for either the daily dominant direction of current average direction.
You are averaging the direction X and Y components to avoid the 360->0 issue (ie the scalar average).
CMX also multiplies each X/Y value by the speed giving a vector average.
In practice I do not know how much of a difference it makes, and it also comes down to how you define the average direction.
You are averaging the direction X and Y components to avoid the 360->0 issue (ie the scalar average).
CMX also multiplies each X/Y value by the speed giving a vector average.
In practice I do not know how much of a difference it makes, and it also comes down to how you define the average direction.
- mcrossley
- Posts: 12903
- 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
Current average uses both speed and direction...
Code: Select all
WindVec[nextwindvec].X = calibratedgust * Math.Sin(DegToRad(Bearing));
WindVec[nextwindvec].Y = calibratedgust * Math.Cos(DegToRad(Bearing));
Code: Select all
DominantWindBearingX += (minutes * averageSpeed * Math.Sin(DegToRad(averageBearing)));
DominantWindBearingY += (minutes * averageSpeed * Math.Cos(DegToRad(averageBearing)));
DominantWindBearingMinutes += minutes;
- HansR
- Posts: 6026
- Joined: Sat 20 Oct 2012 6:53 am
- Weather Station: GW1100 (WS80/WH40)
- Operating System: Raspberry OS/Bookworm
- Location: Wagenborgen (NL)
- Contact:
Re: Rolling Weekly Data - Displaying data on website
It is unclear from Andy's original question (I refer to this post) that he only wants the dominant wind direction.sfws wrote: ↑Mon 15 Aug 2022 8:55 am 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.
You should have wasted your time differently iso posting this confusing article. Even Steve said (your reference):
so you could have known it was not an all easy subject.[...] it does make my head hurt[...]
That indeed is an interesting reference.sfws wrote: ↑Mon 15 Aug 2022 8:55 am 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.
Campaign is your interpretation.
But I must admit that over the two days following your publication of that link an increasing irritation came over me, that somebody who contributes so much to the Wiki, just flings in this reference which has no validity from the pov of CMX (and just claimed he saw it as a waste of time to read it).
You initiated this discussion. I am responsible for my content, not your interpretation. Yes, you irritate me, this sentence adds to that.
It is not only my posts discussing wind speed averaging, it is your linked article - meant as a help for Andy wanting to average direction, claiming in the same breath he did not search well - which treats wind speed and wind direction averaging as a vector, stating that CMX uses that method. Almost everything in that sentence is untrue.
That is very confusing and everybody using that article as a reference would get confused.
Last edited by HansR on Mon 15 Aug 2022 5:48 pm, edited 2 times in total.
Hans
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
- HansR
- Posts: 6026
- Joined: Sat 20 Oct 2012 6:53 am
- Weather Station: GW1100 (WS80/WH40)
- Operating System: Raspberry OS/Bookworm
- Location: Wagenborgen (NL)
- Contact:
Re: Rolling Weekly Data - Displaying data on website
Only to weigh the direction, not to modify the speed which is inherently different from what the vector calculation is in both the article referenced by @sfws and the Copernicus article referenced by me.mcrossley wrote: ↑Mon 15 Aug 2022 10:33 am Current average uses both speed and direction...Dominant direction uses both speed and direction...Code: Select all
WindVec[nextwindvec].X = calibratedgust * Math.Sin(DegToRad(Bearing)); WindVec[nextwindvec].Y = calibratedgust * Math.Cos(DegToRad(Bearing));
Code: Select all
DominantWindBearingX += (minutes * averageSpeed * Math.Sin(DegToRad(averageBearing))); DominantWindBearingY += (minutes * averageSpeed * Math.Cos(DegToRad(averageBearing))); DominantWindBearingMinutes += minutes;
I think I finish my contribution to this thread here unless a very convincing argument comes along.
If I can't convince you then so be it.
Hans
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3