Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Possible problem with wind direction range web tags

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Possible problem with wind direction range web tags

Post by mcrossley »

Steve

I just noticed my wind gauge, over 'longer than' the last 10 minutes the wind speed has been varying between zero and not a lot, but the average is non-zero. The wind direction has been constant at 135 degrees. But the range from/to10 tags are reading 310-320, which is 180 degrees out?

From the realtime file:
"BearingRangeFrom10":"310","BearingRangeTo10":"320"
Capture.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

I suspect it's connected with the zero wind speeds, which of course never happens here. I was outside just now, thinking how amazingly calm and quiet it was, and it's actually F2.

The contents of the <#wspddata> and <#wdirdata> (and <#nextwindindex>) tags would be useful, and whether or not you have 'use bearing zero when calm' set. I don't know when I'll get chance to look at this, though.

Edit: But I see you're now completely becalmed as far as the average goes, so it'll need to be when it manifests itself again, obviously.
Steve
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

steve wrote:whether or not you have 'use bearing zero when calm' set
Actually, I think you probably have, and I think this is the reason for the problem. I'll have to have a think about what to do about that.
Steve
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

I've been thinking about this some more, and I think 'use bearing zero when calm' is a red herring, because the 'range' code uses the 'raw' bearing. But it must be something to do with what happens when it's calm.
Steve
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Possible problem with wind direction range web tags

Post by mcrossley »

steve wrote:Actually, I think you probably have
Correct, I did not capture the wind arrays at the time -if I notice it again I will.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

I'll try to do some experimenting when I get chance, with my WMR200, whose anemometer is sitting on a desk, so I can easily get zero wind speeds from it.
Steve
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Possible problem with wind direction range web tags

Post by beteljuice »

BTW Mark - why does the compass gauge use N for calm ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Possible problem with wind direction range web tags

Post by mcrossley »

beteljuice wrote:BTW Mark - why does the compass gauge use N for calm ?
Well actually I use 000 for calm and 360 for N :lol: but calm is a problem to represent on a 0-360 gauge isn't it? The only other thing I can think of is to not draw the pointer at all?
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Possible problem with wind direction range web tags

Post by gemini06720 »

mcrossley wrote:The only other thing I can think of is to not draw the pointer at all?
Mark, rather than completely removing the pointer (which I would not want), how about 'dimming' (or changing) the colour of the pointer? The pointer would still be pointing at 000° (or 360° depending how you look at it) and be either semi-transparent (if that is possible) or of a lighter colour.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Possible problem with wind direction range web tags

Post by beteljuice »

Or perhaps truncate the pointer to quarter length (just prove there is data but it's lying :lol: )

Re. <#webtags>, I don't know which logic you presented to Steve in the end, but as far as I can see if a 0deg reading were given for calm that would simply increase the vector difference, it wouldn't give the magic 180deg shift with the correct vector difference ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

I'll post my code later, then we can have a group debugging session :)
Steve
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Possible problem with wind direction range web tags

Post by beteljuice »

Here's the beteljuice 'rough guide' :lol:

Javascript logic - a little psuedo code

Code: Select all


// ------- Variable Wind check -------------------------
/* from METAR coding
* if direction varies by 60 deg or more and speed greater than 6 knots,
* a Variable wind direction group is reported (eg. 180V240), otherwise omitted.
* If wind direction is variable and speed 6 knots or less, 
* replace wind direction with VRB followed by wind speed in knots.
*
* This emulates that to provide 'degFrom', 'degTo', and 'vectorSize' variables
*
* METAR wind degrees are rounded to nearest 10 - we work 'normal'
* I am assuming the last 10 min. although some dialogues suggest 2 min.
* 
* Also I can find no info on the ORDER of the 180V240 deg. ie. 60 deg clockwise or 300 deg anti-clockwise ?
* So I am assuming (and coded) to read 'clockwise' (ie. 1st figure could be larger than 2nd.)
* eg 330V030 would be 60 deg 'around' North, 150V240 would be 90 deg 'around' South.
* 
*/

/* Philosophy
*  Get last 10 mins worth of CURRENT wind direction degrees
*  Compare each with CURRENT AVG wind direction degrees to get a + / - 'offset'
*  add (absolutely) the max 'offsets' to get wind 'vector' size
*/
 
/* Prerequisites: - names are for easy reference / substitution
* 
* windDeg10 - an array containing the last 10 minutes of current / now wind DIRECTIONS in degrees
* windVarAvg - the CURRENT 10 minute average wind DIRECTION in degrees
*
* wind_kts_ave - could be any CURRENT AVERAGE SPEED unit, used (or maybe not) to give alternate output
*/

 
				windVar_temp_degDiff = new Array(); // new array to store deviation from CURRENT average
				windVarCount = windDeg10.length; 


				// step through 10min values, calculate the differences to CURRENT avg and populate a new array
				y = 0; // initialise windVar_temp_degDiff[] pointer
				for(x = 0; x < windVarCount; x++) { // go through 10min values
					// work out difference between 'then' current and 'now' 10 min average
// Cumulus, in common with some other softwares, returns 0 degrees if zero wind speed 
// if this is true for the 10min array then at this point you need to do a check and 'jump' to next 'x' to be safe
// if required - if(windDeg10[x] == 0) 'jump' check here
					degDiff_temp = windDeg10[x] - windVarAvg;

					if(degDiff_temp >= 180) {
						degDiff_temp = degDiff_temp -360;
					} else {
						if(degDiff_temp <= -180){
							degDiff_temp = degDiff_temp +360;
						}
					}

					windVar_temp_degDiff[y] = degDiff_temp;
					y++; // increment new array pointer
// if required - END 'jump' check

				} // END 10min step through, new Array windVar_temp_degDiff has been populated with difference to average
				
				// find (plus / minus) deviation extremes - arrayMax() and arrayMin() are 'invented' functions
				degHi = arrayMax(windVar_degDiff); // positive values, might NOT be initially, if the (wx) avg period has not been completed ;-)
				degLo = arrayMin(windVar_degDiff); // negative values, might NOT be initially, if the (wx) avg period has not been completed ;-)

				// Belts 'n' Braces - Lo must be lower or equal to avg, Hi must be higher or equal to avg
				if(degLo > 0) {degLo = 0;}
				if(degHi < 0) {degHi = 0;}

// so now we have the max +/- deviation with respect to CURRENT average direction 

				// Now workout max 'vector' size !!
				vectorSize = degHi + Math.abs(degLo);

// FINALLY - workout logical from > to values eg. 350 15 would be straddling North
// average SPEED check is optional, you may also decide eg. a vectorSize < 10 is irrelevant ? - upto you
				if(wind_kts_ave > 0) { // need to build output as [from to]
					degFrom = windVarAvg + degLo; 
					if(degFrom < 0){degFrom = 360 + degFrom;} 
					degTo = windVarAvg + degHi; // 
					if(degTo > 360){degTo=degTo-360;}
				}else{ // NORMAL - I choose to o/p ave, but it could be null or current
					// *** PUT ALTERNATIVE VALUES HERE !!! *************
				}// END if average SPEED 

// END Variable Wind

// So now you have degFrom, degTo, and vectorSize all in integer degrees available for 'output'
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

Yes, I've seen that, Mark posted his and yours in the enhancement request. 'My' code uses part of yours, part of Mark's, and a light sprinkling of my own. This is probably why there's a bug in it :lol:
Steve
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Possible problem with wind direction range web tags

Post by mcrossley »

It's happening again, and there are zero wind speeds. Unfortunately I am still at work and cannot RDP in to the server until I get to the hotel and out from behind our corporate proxy server.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Possible problem with wind direction range web tags

Post by steve »

At least that confirms that zero wind speeds cause the problem. I haven't had chance to experiment yet.
Steve
Post Reply