Author Topic: Writing software which ensures short term gusts are not missed  (Read 657 times)

0 Members and 2 Guests are viewing this topic.

Offline Plainwind

  • Member
  • *
  • Posts: 19
Writing software which ensures short term gusts are not missed
« on: February 20, 2021, 12:37:07 PM »
In extreme wind conditions, the duration of gusts can be very short, typically much less than 1 second.  How can software be designed to avoid missing gusts?  For example, if my software is designed to continuously monitor wind speed but also periodically do some mean and max calculations and append a record to a database, how can I write my software to be sure that during the time it's doing the calculations and database append, no short duration gusts are missed?  By the way, I'm writing my code in Python and running it on a Raspberry Pi.

Offline davidg_nz

  • Member
  • *
  • Posts: 9
    • Sandy Bay Weather
Re: Writing software which ensures short term gusts are not missed
« Reply #1 on: March 03, 2021, 10:39:41 PM »
What sort of weather station are you talking to? Trying to measure an anemometer directly hooked up to one of the Pis GPIO pins or receiving data from an off-the-shelf weather station?

Offline Mattk

  • Forecaster
  • *****
  • Posts: 1506
Re: Writing software which ensures short term gusts are not missed
« Reply #2 on: March 04, 2021, 05:32:38 AM »
Depends on your definition of what a wind gust is? This is going to be where the problem lies.

Offline Plainwind

  • Member
  • *
  • Posts: 19
Re: Writing software which ensures short term gusts are not missed
« Reply #3 on: March 06, 2021, 03:20:05 AM »
What sort of weather station are you talking to? Trying to measure an anemometer directly hooked up to one of the Pis GPIO pins or receiving data from an off-the-shelf weather station?



Thanks for replying.  To answer your question - my sensors, including the anemometer, are currently directly connected to GPIO pins.  To calculate windspeed, I'm counting the rotations using Button().

However, having given this more thought, I think I can answer my own question.  Rather than connecting the anemometer direct to the Pi, I need to incorporate a data-logger which continuously monitors the anemometer output, regardless of what processing the Pi is doing.  So, I need to do some research on data-loggers and how to put a data-logger between the sensors and the Pi.

Offline Plainwind

  • Member
  • *
  • Posts: 19
Re: Writing software which ensures short term gusts are not missed
« Reply #4 on: March 06, 2021, 04:11:03 AM »
So, I'm going to look at threading in Python with a view to using the Raspberry Pi to simultaneously be both a real-time data-logger and a device for processing and analysing the raw data collected by the data-logger.  Any pointers to help on this appreciated.

Offline Garth Bock

  • Table Rock Lake Weather
  • Forecaster
  • *****
  • Posts: 2363
Re: Writing software which ensures short term gusts are not missed
« Reply #5 on: March 06, 2021, 09:45:38 AM »
The problem is in your sampling rate. That is how gusts are missed. The higher the sampling rate the better way to catch a gust but the downside is the higher amount of data recorded approaching analog. The best way is to have a separate routine running that has a trigger with a limit where it determines if a gust is occurring and then starts the logging process.

Offline Plainwind

  • Member
  • *
  • Posts: 19
Re: Writing software which ensures short term gusts are not missed
« Reply #6 on: March 07, 2021, 06:04:00 PM »
Garth, thanks for this insight.
Yes - I see what you mean.  Measuring wind speed digitally, i.e. by counting anemometer rotations over a given duration, say 1 second, has the limitation that it will not capture a gust of duration less than 1 second.  So, to be sure of capturing the true speed of a gust, you need either a method which produces multiple pulses per revolution (e.g. a slotted disk - like Vector Instruments) or a truly analogue method which represents wind speed by the magnitude of a voltage.

Offline sky_watcher

  • Senior Member
  • **
  • Posts: 88
Re: Writing software which ensures short term gusts are not missed
« Reply #7 on: March 08, 2021, 01:28:40 AM »
Garth, thanks for this insight.
Yes - I see what you mean.  Measuring wind speed digitally, i.e. by counting anemometer rotations over a given duration, say 1 second, has the limitation that it will not capture a gust of duration less than 1 second.  So, to be sure of capturing the true speed of a gust, you need either a method which produces multiple pulses per revolution (e.g. a slotted disk - like Vector Instruments) or a truly analogue method which represents wind speed by the magnitude of a voltage.
Ever considered using an interrupt driven counter? I do that on an Arduino for a radiation counter, so I can't imagine it won't work on a Pi.

If you are really serious about not missing anything, set up a hi-res counter-timer clock and record the time from that device each the interrupt fires. Within the resolution of the clock and physical limits of the anemometer, you can then calculate the instantaneous wind with just two anemometer pulses.
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Offline Mattk

  • Forecaster
  • *****
  • Posts: 1506
Re: Writing software which ensures short term gusts are not missed
« Reply #8 on: March 08, 2021, 02:58:57 AM »
The question still remains? What is a wind gust and how do you define it? At what point does all this become impractical and meaningless?

Offline sky_watcher

  • Senior Member
  • **
  • Posts: 88
Re: Writing software which ensures short term gusts are not missed
« Reply #9 on: March 08, 2021, 05:16:23 AM »
The question still remains? What is a wind gust and how do you define it? At what point does all this become impractical and meaningless?
If you want to use the World Meteorological Office (WMO) standard definitions, just google their observational standards. It discusses things like the 3s Peak Average, the 10-min standard observation average, and so on.

If not, use whatever takes your fancy.
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Offline Cutty Sark Sailor

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3221
    • Frankfort Weather - TwinHollies WeatherCenter
Re: Writing software which ensures short term gusts are not missed
« Reply #10 on: March 08, 2021, 06:59:54 AM »
Perhaps calculate your custom Gust definition based on maximum windspeed in sample period and/or data update period. More samples / shorter period will improve 'reolution'. Average as desired... say 20-50 samples per minute, database update 1 minute. you'll be limited by sensor's design, getting under one second period likely problematic off-the-shelf????. Get large storage device(s) for records. :)
 

 

anything