Page 2 of 2

Re: Wind speeds

Posted: Sat 07 Mar 2020 9:50 pm
by beteljuice
@sfws ..
Too simplistic ...

Code: Select all

$latest	= max( <#wlatest>,<#wgust>);
<#wgust> will persist for 10 min.


@Ralph1

Are you really trying to maintain a database of 1sec entries ?
That's 31,557,600 x number of data fields per year !!!!!

Re: Wind speeds

Posted: Sun 08 Mar 2020 1:22 pm
by sfws
beteljuice wrote: Sat 07 Mar 2020 9:50 pm @sfws ..
Too simplistic ...

Code: Select all

$latest	= max( <#wlatest>,<#wgust>);
<#wgust> will persist for 10 min.
I already said it was not a solution to solving his problem, it was a hint along the way. As I also said, I would need to understand what he is trying to do, to go any further.

Re: Wind speeds

Posted: Mon 09 Mar 2020 8:09 pm
by Ralph1
I use the CumulusMx Extra Web files to create a file called myrealtime.txt which contains my meteorological parameters including #wlatest for instantaneous wind speed and #wspeed for average wind speed. I have looked at #wgust but it remains at the last gust speed for I think the previous 10 minutes. My object as stated previously is to make sure that the maximum gust speeds are present in #wlatest which means some sort of logic to make sure that if #wgust goes higher than #wlatest then it sets #wlatest to #wgust for one sample and not for any more until the next time #wgust exceeds its previous value. My software which gathers the data from the above file uses Visual Basic and keeps up easily with the rate at which data is being sent. So that is where I can create the logic to make sure that the above happens but it is a slightly tricky problem to make it work.
The data actually goes into Weather Display in Client Mode which displays quite clearly when a gust occurs and nearly always using #wlatest by itself, such a gust is less than the #wgust signal for reasons I don't understand. After being in WD the data gets written out to my database which is somewhere in the south of England.

I hope this explains what I am trying to do and it is frustrating that the gust speed is missing from the values of #wlatest as often as it is. Before I tried to use Metplus, I had the old Metlog data logger and that only had two wind speed signals, they were the equivalent of #wspeed and #wlatest and all gusts of wind speeds appeared in #wlatest. These signals in that case appeared at 0.5 second intervals and it worked really well until the Metlog unit finally gave up the ghost.

John

Re: Wind speeds

Posted: Mon 09 Mar 2020 11:31 pm
by sfws
Visual Basic eh, yes during the middle of my working life, I could do a lot with that.
I even have a fat book called "Visual Basic 2005 step by step", although I'm not sure if I will ever read it again. I suspect I brought that when I stopped using VB at work in case I did ever need to use VB again. I'm too rusty, too old to re-learn VB ... so I won't try to write the exact code for you.

But I think you could take a copy of #wgust, and compare against that to spot when #wgust changes (I said before you can make that every minute instead of every 10).
Alternatively, visual basic has a timer function, from the little I can recall I used that in the past to code something to change every minute or some other interval, so for you that could kick off the code to compare with #wgust again.

You can compare #wlatest with #wgust just once, and then use #wlatest as you say while you wait for the other comparison/timer to signal a need to compare again.
This probably requires just one or perhaps two "if ... then ... elseIf ... else .. endif" type constructions.

Re: Wind speeds

Posted: Tue 10 Mar 2020 9:06 am
by mcrossley
Which is what Cumulus does for some other stations - use the live current feed, then once a minute check the gust value, if it has increased since the last time we checked and greater than current, set current to gust, and stash the old gust value.

Re: Wind speeds

Posted: Sat 23 May 2020 7:52 pm
by Ralph1
I am sorry that I have not contributed to this topic for some time. Basically the problem is that wind gust speeds in CumulusMX output often don't appear in the signal "#latest". As I use Weather Display which only has two inputs for wind, i.e instantaneous wind and average I had to find a way round this. I do not understand why the gust signals often fail to appear in #wlatest, there must be a design flaw there somewhere. The old Instromet Metlog datalogger system didn't have any problem of this sort, it just outputted the instantaneous speed and the average speed, with the gust speed included in the instantaneous speed and these could be fed directly into WD.

The way I have solved it is as follows:
First of all I now input 3 wind speed numbers from CumulusMX. These are #wspeed, #wlatest and #wgust. I have also created a variable called oldgust.
Now I actually use VB to do the calculations, the first thing I do is to check if #wgust has changed from it's previous value oldgust. If it has not then #latest is used as the correct instantaneous speed. If it has changed, that means that there is a new value of gust speed #wgust created and the next thing is to check if #latest is less than #wgust. If it is then #wgust is used as the new value for #wlatest. ( I don't use the actual quantities as below but defined VB quantities. I have used the values shown here to help indicate what's going on.
In software this is as follows: if (#wgust <> #oldgust) then
oldgust = #wgust
if (#wlatest < #wgust) then
#wlatest = #wgust
Endif
Endif
I hope these equations turn out as I see them here. The first line checks that the two quantities are not equal. If they are equal then nothing happens. If they are not equal, the next if statement attempts to find if #wgust is greater than the current #wlatest. If it is then #wgust gets substituted for #wlatest this one time. Next time around, with the next set of readings, because #wgust won't have changed, then the if statements do nothing and will only do something the next time #wgust changes - which is likely to happen in up to 10 minutes later depending on the speed of the wind.

Ralph1