Current Windspeed in Beaufort ? Bft?

1,324 views
Skip to first unread message

Ronald Wildner

unread,
Mar 16, 2014, 4:08:27 AM3/16/14
to weewx...@googlegroups.com
I am wondering if there is any hint to display current WindSpeed in Beaufort !
I used google and the search -function, but could not find anything adequate ;-)

Andrew Milner

unread,
Mar 16, 2014, 5:06:28 AM3/16/14
to weewx...@googlegroups.com
To convert knots to Beaufort add 5 to the windspeed in knots, then divide by 5.

To convert mph to Beaufort add 6 and divide by 6.

Ronald Wildner

unread,
Mar 16, 2014, 5:12:16 AM3/16/14
to weewx...@googlegroups.com
Thanks for the quick anwer ...
I am pretty new to weewx ...
 how can I now  add the calculated bft to my template ... (something like $current.windSpeed.bft) ?

Andrew Milner

unread,
Mar 16, 2014, 7:53:38 AM3/16/14
to weewx...@googlegroups.com
the simplest way would be to replace $current.windSpeed with something like (($current.windSpeed.raw + 5) * 5) in the templates wherever needed I would have thought.  More comolex to actually add the unit type to be generally available, but possible - read the user manual for more details on unit types  - under extensions I think, but could be ustomisation - not sure which it comes under!!


--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/b7TqpYD9sxY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronald Wildner

unread,
Mar 16, 2014, 11:50:02 AM3/16/14
to weewx...@googlegroups.com
Thanks !
 With $current.windSpeed.raw and some Javascript  it was easy and fits perfectly for me ! .raw was what I was looking for ;-)

Eelco F

unread,
Feb 10, 2017, 1:35:59 PM2/10/17
to weewx-user
I do have a question on this.

I noticed that as of weewx 3.2 there is a beaufort calculation in Stdwxcalculate, right?

Now how do I get beaufort values in my reports? Until now I used javascript too, but it should be possible directly from weewx?

Ef

Op zondag 16 maart 2014 09:08:27 UTC+1 schreef Ronald Wildner:

wysiwyg

unread,
Feb 16, 2017, 4:00:59 AM2/16/17
to weewx-user
Hi
in case you like PHP, I have done this Beaufort calculation this way (with a small PHP code inside my template file)

<?php 
            \$vitesse = 0$current.windSpeed.raw;
            if ("$unit.label.windSpeed" == " km/h") {
              \$bff="0-Calme";
              if (\$vitesse > 1) \$bff="1-Trés Légère Brise";
              if (\$vitesse > 6) \$bff="2-Légère Brise";
              if (\$vitesse > 12) \$bff="3-Petite Brise";
              if (\$vitesse > 20) \$bff="4-Jolie Brise";
              if (\$vitesse > 29) \$bff="5-Bonne Brise";
              if (\$vitesse > 39) \$bff="6-Vent Frais";
              if (\$vitesse > 50) \$bff="7-Grand Frais";
              if (\$vitesse > 62) \$bff="8-Coup de Vent";
              if (\$vitesse > 75) \$bff="9-Fort Coup de Vent";
              if (\$vitesse > 89) \$bff="10-Tempête";
              if (\$vitesse > 103) \$bff="11-Violente Tempête";
              if (\$vitesse > 118) \$bff="12-Ouragan"; 
            }
          else {\$bff="to be updated for other than km/h"; }
          echo \$bff;
          ?>

The text is in french, but it should be easy to remove or replace by any language.

Also I handle only windspeed in km/h (just because it's my default unit and I was lazy to handle all units :-)). but it's easy to adjust too.

Best regards,

wysiwyg

unread,
Aug 17, 2017, 5:32:52 PM8/17/17
to weewx-user
Hi there!

I have seen  some mentions about beaufort in version logs and bit in the weewx code, but I was not able to figure out how to use it ?

I tried:  $current.beaufort....this works (it does not crash cheetah) but weird result:$current.beaufort=?'beaufort'?

I tried: month.beaufort.max: it does crash cheetah.

How can we use this ?

Best regards,

  

gjr80

unread,
Aug 17, 2017, 7:09:41 PM8/17/17
to weewx-user
Hi,

At the moment the weeWX tag system does not support Beaufort wind speeds. WeeWX has a function in bin/weewx/wxformaulas.py to calculate Beaufort wind speed but it is not used. You have seen Beaufort mentioned in the change log, Beaufort was added to the StdWXCalculate service but it is presently disabled; I am not sure why this is so - Matthew maybe able to answer that one.

So the only way to include Beaufort wind speed in a template now is through in-line python code in the template (example in the gauge-data.txt template here - code starts at line 170) or create a search list extension to calculate the Beaufort wind speed - this could use the beaufort() function in wxformuals.py. In theory, you could enable beaufort in StdWXCalculate and would then have access to the $current.beaufort tag in reports, but as I said I am not sure why this was disabled. Finally, you can do as you and others have and calculate it externally to weeWX if its to be used on a web page or elsewhere.

Gary

mwall

unread,
Aug 22, 2017, 12:38:01 PM8/22/17
to weewx-user
On Thursday, August 17, 2017 at 7:09:41 PM UTC-4, gjr80 wrote:
At the moment the weeWX tag system does not support Beaufort wind speeds. WeeWX has a function in bin/weewx/wxformaulas.py to calculate Beaufort wind speed but it is not used. You have seen Beaufort mentioned in the change log, Beaufort was added to the StdWXCalculate service but it is presently disabled; I am not sure why this is so - Matthew maybe able to answer that one.

i did the beafort implementation in StdWXCalculate, then i realized that beafort should be just another unit for windSpeed, not a separate observation type

imho you should be able to do:

$current.windSpeed.beafort

not

$current.beafort

Andrew Milner

unread,
Aug 22, 2017, 12:44:17 PM8/22/17
to weewx-user
That makes perfect sense Matthew - it should indeed just be another unit associated with windspeed , as you say.

WindnFog

unread,
Aug 22, 2017, 4:14:20 PM8/22/17
to weewx-user
If you want to avoid Java, I cobbled together some code based on gjr80's template and added it to /etc/weewx/skins/Standard/index.html.tmpl as follows:

##        Calculate today's highest Beaufort based on wind speed in knots
     
          #if $varExists('day.windSpeed') and $day.windSpeed.max.raw is not None
          #if $unit.unit_type.windSpeed == 'mile_per_hour'
          #set $kts = $day.windSpeed.max.raw * 0.8689762
          #elif $unit.unit_type.windSpeed == 'km_per_hour'
            #set $kts = $day.windSpeed.max.raw * 0.539956
          #elif $unit.unit_type.windSpeed == 'meter_per_second'
            #set $kts = $day.windSpeed.max.raw * 1.943844
          #elif $unit.unit_type.windSpeed == 'knot'
            #set $kts = $day.windSpeed.max.raw
          #else
            #set $kts = 0
          #end if
          #if $kts < 1
            #set $beaufort = 0
            #set $word_beaufort = 'Calm'
          #elif $kts < 4
            #set $beaufort = 1
            #set $word_beaufort = 'Light air'
          #elif $kts < 7
            #set $beaufort = 2
            #set $word_beaufort = 'Light breeze'
          #elif $kts < 11
            #set $beaufort = 3
            #set $word_beaufort = 'Gentle breeze'
          #elif $kts < 17
            #set $beaufort = 4
            #set $word_beaufort = 'Moderate breeze'
          #elif $kts < 22
            #set $beaufort = 5
            #set $word_beaufort = 'Fresh breeze'
          #elif $kts < 28
            #set $beaufort = 6
            #set $word_beaufort = 'Strong breeze'
          #elif $kts < 34
            #set $beaufort = 7
            #set $word_beaufort = 'High wind'
          #elif $kts < 41
            #set $beaufort = 8
            #set $word_beaufort = 'Gale'
          #elif $kts < 48
            #set $beaufort = 9
            #set $word_beaufort = 'Strong gale'
          #elif $kts < 56
            #set $beaufort = 10
            #set $word_beaufort = 'Storm'
          #elif $kts < 64
            #set $beaufort = 11
            #set $word_beaufort = 'Violent storm'
          #else
            #set $beaufort = 12
            #set $word_beaufort = 'Hurricane'
          #end if
          #else
            #set $beaufort = 'N/A'
          #end if


 Put the above somewhere near the top, and then modify the Since Midnight table by adding a couple of lines in the High Wind row:

                <td class="stats_label">
                  High Wind<br/>
                  High Beaufort Scale
                </td>
                <td class="stats_data">
                  $day.wind.max from $day.wind.gustdir at $day.wind.maxtime<br/>
                  $beaufort or $word_beaufort at $day.wind.maxtime
                </td>

- Paul VE1DX

https://www.ve1dx.net/





On Sunday, March 16, 2014 at 12:50:02 PM UTC-3, Ronald Wildner wrote:
Thanks !
 With $current.windSpeed.raw and some Javascript  it was easy and fits perfectly for me ! .raw was what I was looking for ;-)


Am Sonntag, 16. März 2014 12:53:38 UTC+1 schrieb Andrew Milner:
the simplest way would be to replace $current.windSpeed with something like (($current.windSpeed.raw + 5) * 5) in the templates wherever needed I would have thought.  More comolex to actually add the unit type to be generally available, but possible - read the user manual for more details on unit types  - under extensions I think, but could be ustomisation - not sure which it comes under!!
On 16 March 2014 11:12, Ronald Wildner <ronwi...@gmail.com> wrote:
Thanks for the quick anwer ...
I am pretty new to weewx ...
 how can I now  add the calculated bft to my template ... (something like $current.windSpeed.bft) ?
Am Sonntag, 16. März 2014 09:08:27 UTC+1 schrieb Ronald Wildner:
I am wondering if there is any hint to display current WindSpeed in Beaufort !
I used google and the search -function, but could not find anything adequate ;-)

--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
Message has been deleted

david

unread,
Aug 22, 2017, 7:18:38 PM8/22/17
to weewx...@googlegroups.com
-> On Tue, 22 Aug 2017 09:38:00 -0700 (PDT) mwall took time to scribe <-

>On Thursday, August 17, 2017 at 7:09:41 PM UTC-4, gjr80 wrote:
>>
>> At the moment the weeWX tag system
>> <http://weewx.com/docs/customizing.htm#Tags> does not support Beaufort
>> wind speeds. WeeWX has a function in bin/weewx/wxformaulas.py to
>> calculate Beaufort wind speed but it is not used. You have seen Beaufort
>> mentioned in the change log, Beaufort was added to the StdWXCalculate
>> service but it is presently disabled; I am not sure why this is so -
>> Matthew maybe able to answer that one.
>>
>
>i did the beafort implementation in StdWXCalculate, then i realized that
>beafort should be just another unit for windSpeed, not a separate
>observation type
>
>imho you should be able to do:
>
>$current.windSpeed.beafort
>
>not
>
>$current.beafort
>


This did not work for me however I modified the code by Windnfog and now
have Beaufort showing on my site.



.-.-.-.-.-.-.

David Taylor, Puniho
'the place to be; beneath the Mountain, beside the Sea'
http://www.pwx.kiwi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
whose computer uses linux/open source software, featuring
Mageia release 5 (Official) for x86_64, kernel 4.4.82-desktop-1.mga5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

david

unread,
Aug 22, 2017, 7:21:52 PM8/22/17
to weewx...@googlegroups.com
Thanks for this. After modifying it for current I having it working on my
site. I found that your code was missing an '$' for day.windSpeed.

-> On Tue, 22 Aug 2017 13:14:19 -0700 (PDT) WindnFog took time to scribe <-

David Hathaway

unread,
Aug 23, 2017, 9:11:08 AM8/23/17
to weewx-user
Thank you.  Worked perfectly for me.  Since we are likely to be hit by a tropical storm in the next day or two (I live in Houston, Texas), this will be pretty interesting.

WindnFog

unread,
Aug 23, 2017, 10:44:03 AM8/23/17
to weewx-user

I think I made a mistake on the cut and paste into the email and missed the $.  Glad it worked out for you. 


It was a quick and dirty coding example of one way to do it.  There may be better ways . . .


-- 
- Paul VE1DX

------------------

Paul M Dunphy
Lake Echo, Nova Scotia

https://www.ve1dx.net  <--- Weather station

Stefan Schnidrig

unread,
Jul 11, 2019, 8:04:12 AM7/11/19
to weewx-user
Hi Guys.
I've read this discussion here and wanted to ask you if there is any other solution than php or rewrite the file? There would have to be an easier option?

Thank you


Am Sonntag, 16. März 2014 09:08:27 UTC+1 schrieb Ronald Wildner:

WindnFog

unread,
Jul 11, 2019, 8:12:35 AM7/11/19
to weewx-user
I use this code in my  file:


##        Calculate today's current Beaufort based on wind speed in knots
     
          #set $current_kts = 0
          #if $varExists('day.windSpeed') and $current.windSpeed.raw is not None
          #if $unit.unit_type.windSpeed == 'mile_per_hour'
          #set $current_kts = $current.windSpeed.raw * 0.8689762
          #elif $unit.unit_type.windSpeed == 'km_per_hour'
            #set $current_kts = $current.windSpeed.raw * 0.539956
          #elif $unit.unit_type.windSpeed == 'meter_per_second'
            #set $current_kts = $current.windSpeed.raw * 1.943844
          #elif $unit.unit_type.windSpeed == 'knot'
            #set $current_kts = $current.windSpeed.raw
          #else
            #set $current_kts = 0
          #end if
          #if $current_kts < 1
            #set $current_beaufort = 0
            #set $word_current_beaufort = 'Calm'
          #elif $current_kts < 4
            #set $current_beaufort = 1
            #set $word_current_beaufort = 'Light air'
          #elif $current_kts < 7
            #set $current_beaufort = 2
            #set $word_current_beaufort = 'Light breeze'
          #elif $current_kts < 11
            #set $current_beaufort = 3
            #set $word_current_beaufort = 'Gentle breeze'
          #elif $current_kts < 17
            #set $current_beaufort = 4
            #set $word_current_beaufort = 'Moderate breeze'
          #elif $current_kts < 22
            #set $current_beaufort = 5
            #set $word_current_beaufort = 'Fresh breeze'
          #elif $current_kts < 28
            #set $current_beaufort = 6
            #set $word_current_beaufort = 'Strong breeze'
          #elif $current_kts < 34
            #set $current_beaufort = 7
            #set $word_current_beaufort = 'High wind'
          #elif $current_kts < 41
            #set $current_beaufort = 8
            #set $word_current_beaufort = 'Gale'
          #elif $current_kts < 48
            #set $current_beaufort = 9
            #set $word_current_beaufort = 'Strong gale'
          #elif $current_kts < 56
            #set $current_beaufort = 10
            #set $word_current_beaufort = 'Storm'
          #elif $current_kts < 64
            #set $current_beaufort = 11
            #set $word_current_beaufort = 'Violent storm'
          #else
            #set $current_beaufort = 12
            #set $word_current_beaufort = 'Hurricane'
          #end if
          #else
            #set $current_beaufort = 'N/A'
          #end if 
         

WindnFog

unread,
Jul 11, 2019, 8:14:48 AM7/11/19
to weewx-user
 That should read "I use this code in my /etc/weewx/skins/Standard/index.html.tmpl file:
Reply all
Reply to author
Forward
0 new messages