Low winds mostly northerly

@dsj So this is a good example of a problem I have, but I’m not sure if it is a software bug, or a problem with the sky calibration or the sky sensors.
When the wind speed is low (but not zero) the wind mostly comes from almost north, when wind picks up it goes to the real direction, going back to north when wind speed gets low. I’m not sure if it is a bug, but it is conceivable as zero wind speed is reported as coming from the north, but those values should not contribute to the average wind direction. Powersave mode or not, doesn’t make a lot of difference.
Untitled-1

1 Like

later in the day I got this, mostly westerly winds, but when the wind speed briefly drops to low values, it turns to the North
Untitled-1

@dsj Was this ever confirmed as a bug or not as I tend to see very similar behaviour? I want to do some calculations to check how the average matches up to the three second wind updates, but it does seem unusually consistent that when the wind speed is low the direction is almost always from the north, and when the wind speed picks up, the direction switches to a more reasonable direction.

Screenshot_20181010-073105

Somewhere here it is already disccuessed: as the wind speed is 0 the direction is always although 0 deg.
Does this answers your question ?

2 Likes

It answers my question somewhat, but the bug still exists if these 0 degree values are not excluded when calculating the 1-minute average. That’s what I want to confirm with @dsj or my own calculations.

Here’s a very rough example. Say the wind conditions were generally calm, and during a 1-minute period the wind blew at 10 mph from the west (270 degrees) for only one three-second period. It was calm for the remainder of the 1-minute period. Common sense would suggest that the average wind direction during that period was 270 degrees. However, if all the 0 degree values when the wind was calm were not excluded, the average would be artificially skewed towards the north.

1 Like

hi peter

your observation on averages is completely correct i observed this continuous 0 degrees when its not even under windy conditions its very rare in all my years of observing wind direction here to see a frequent or constant 0 degrees north .

so what i do and running the weatherflow sky alongside a traditional method both report at 3 second intervals is use an average of 5 minutes to get a good reliable or relative indication , i also have to remove the 0deg by simply if windiraverage >0 do stuff…else do nothing

example of recording wind direction average to mysql

i think as one of the weatherflow staff mentioned they encourage third party manipulation of the data.

you can set the average period length to whatever is suitable per application or personal preference .

i also remove the zero wind gust speed as the amount of days of calmness in a year here you could count on one hand … again if windspeed or windgust >0 do stuff …

the other hack if that’s appropriate phrase is if winddirection actual equals 0 you could revert to the average direction momentarily for display obviously you can call the last known direction if the 0 degrees is being removed. .

average direction chart for today with no 0 degrees

image

brian

2 Likes

Peter,

I preformed the calculations months ago and found that the zero wind is not counted in the one minute average. I posted the formula in another thread here.

2 Likes

Thanks @GaryFunk. I’ll have a play around with this tonight and try and convince myself all is good!

1 Like

We’ve just finished looking into this and while we actually report a direction of “NULL” when wind speed is zero in the individual wind samples (you can see this in the “rapid wind” data - there is no direction at all when the speed is zero), we were erroneously including those NULLs as zeroes in the average direction calculation. That’s was introducing a North bias at low speeds (the more 0 speed measurements in a given observation period, the more North bias). We’ll fix that in the next firmware update!

8 Likes

thanks. looking forward to it.

1 Like

Are you saying that when the wind speed is zero, the direction in the rapid_wind ob should be “None”? I only ask because this isn’t what I see. If I stream the rapid_wind obs via the websocket, when the wind speed is zero, the direction is also zero (not None). For example:

[1539589655, 0.0, 0]
[1539589805, 0.0, 0]
[1539589808, 0.0, 0]

2 Likes

{“serial_number”:“SK-00010789”,“type”:“rapid_wind”,“hub_sn”:“HB-00001310”,“ob”:[1539596399,0.00,0]}

1 Like

I’m confused too. It’s been this way for the 18 months I’ve been working on the project. The Rapid Wind data matched almost perfect when I did the calculations. I found one small issue which I emailed David about and he confirmed the code I used was almost identical to the WeatherFlow code.

2 Likes

Hmm, yes, I did say that… but I was wrong! In fact, the Smart Weather apps do display direction as NULL when speed is zero, but that logic is on the client side. The direction is reported as zero (not NULL) in the rapid_wind message, but it should be NULL, since wind direction is undefined when wind speed is zero. We may address this in a future firmware update, although it would probably break a lot of things downstream, so I’m not sure what the appetite from developers would be for that. The alternative would be to just make sure developers know they should treat direction as NULL when speed is zero.

2 Likes

You can use 360 when wind is actually from the North.

That would break any software that tears apart the data and expects everything as a numerical value like all your other measurements that I’ve seen so far other than calibration messages, but as long as we know to trap for that kind of thing, I guess we can deal with it before you updated a firmware (if we knew in advance).

When you say NULL do you mean a value of '' (like single-quote single-quote with no spaces in between) or a literal string NULL ?

Also disagree with the suggestion to use 360, as that seems pretty kludgy to me.

1 Like

It’s JSON data so the field would contain the word null with no quotes, just like it does now in the Sky data.

“obs”:[[1493321340,9000,10,0.0,2.6,4.6,7.4,187,3.12,1,130,null,0,3]],

If the application is written correctly it will cause no issue.

I’m fine either way.

4 Likes

I have been going through my code in WFArchive and I am finding some areas where I am using zero instead of null. It’s a pain to fix but better to fix it now than to dig the hole deeper.

4 Likes

After giving this more thought I am going to convert the zero reading to null before I handle the data. It is a better way to handle a ‘no value’ value. It should be NULL and you should consider changing it.

Give developers a period of time to prepare and just do it. I’m going to code for it today.

It is only logical.

2 Likes

@dsj, I have a question.

In obs_sky, when the values of the obs index 4, 5 or 6 are zero, should these be NULL? If obs index 7 is zero, should it and index 4, 5 and 6 also be NULL?

I think any zero wind reading should actually be NULL instead of zero.