Airport runways - windvector calculation

317 views
Skip to first unread message

jordi.wa...@gmail.com

unread,
Apr 12, 2014, 5:18:31 PM4/12/14
to weewx-de...@googlegroups.com
Hi,

I want to customize weewx to calculate and display wind vectors for a given airport runway, using the current windSpeed and windDir. (windvector in runway direction and its crosswind vector)

I am thinking and testing it like this:
  • Putting the runway directions (heading) in the weewx.conf file. 
  • Creating a new service (inheriting from class StdService) which calculates the vectors for every NEW_ARCHIVE_RECORD event triggered: Retrieve windSpeed, windDir from the the new record. Retrieve runway directions from the config dictionary. Calculate current runway wind vectors.
Now how do I get the values to the Cheetah template engine so that I can reference them in a template? Do I need to store them in the Archive as new statistics? I am not interested in storing the calculated values. I have looked at the MyXSearch extension for updating the search list. But I don't see how I can pass on the values here. I am new to Python, but have a fair understanding of classes/OO.

I think that digging through the weewx source code is an excellent way to learn both Python and Object mechanisms! What a well structured piece of software!

/Jordi
 

Andrew Milner

unread,
Apr 12, 2014, 5:38:34 PM4/12/14
to weewx-de...@googlegroups.com
Where are you trying to put the resultant crosswind?  If it is to update a webpage why not just take a simple route and put the calculation in the template
I found the following 'rule of thumb' on pprune for crosswind components that should be easy to calculate for a known airfield/runway orientation
Crosswind = Reported windspeed x (angle + 20)/100

an example:

RWY 21 
W/V 250/30

X = 30 x (40 + 20) / 100 = 18kn
... so u could ahve a table of runways and calculate the crosswind for each and have on the web page which would then be updated every archive interval

Thomas Keffer

unread,
Apr 12, 2014, 8:59:49 PM4/12/14
to Andrew Milner, weewx-de...@googlegroups.com
If all you're doing is a simple geometric calculation like Andrew outlined, it would be easiest to either put it in the template, or to write a custom search list extension.

The former is the quick hack, the latter lets you use it elsewhere in your templates.

Now, if a .gif is associated with it, that's a different problem.

-tk

jordi.wa...@gmail.com

unread,
Mar 25, 2016, 5:21:05 AM3/25/16
to weewx-development, andrew.s...@gmail.com
In the end I did the crosswind calculations in the template which indeed works fine. I also created a new generator which does the following:
  • Retrieve most recent dbrecord
  • Use matplotlib to plot the current windvector + speed onto a PNG image with runway outlines
The plot is shown in the standard page.
http://nsf.se/wx/index.html

All this using version 2.6.4. Now I want to upgrade to the most recent version of weewx and review the custom generator. Since I created this 2 years ago with limited Python skills, there are certainly things to be improved :-)

Question:
I currently subclass CachedReportGenerator, but the reportengine has changed and the class has been removed.
What is the best way to configure weewx to create this custom image?

/Jordi

mwall

unread,
Mar 25, 2016, 9:27:44 AM3/25/16
to weewx-development, andrew.s...@gmail.com
On Friday, March 25, 2016 at 5:21:05 AM UTC-4, jordi.wa...@gmail.com wrote:
In the end I did the crosswind calculations in the template which indeed works fine. I also created a new generator which does the following:
  • Retrieve most recent dbrecord
  • Use matplotlib to plot the current windvector + speed onto a PNG image with runway outlines
The plot is shown in the standard page.
http://nsf.se/wx/index.html

All this using version 2.6.4. Now I want to upgrade to the most recent version of weewx and review the custom generator. Since I created this 2 years ago with limited Python skills, there are certainly things to be improved :-)

Question:
I currently subclass CachedReportGenerator, but the reportengine has changed and the class has been removed.
What is the best way to configure weewx to create this custom image?


jordi,

plotting the wind direction directly on the runway diagram is wonderful!  so simple, yet so effective.

the weewx upgrade guide has some details about changes to API.  please take a look at the 'Generator APIs' section in 'From 2.7 or earlier':

http://www.weewx.com/docs/upgrading.htm

m

jordi.wa...@gmail.com

unread,
Apr 18, 2016, 7:02:23 AM4/18/16
to weewx-development
Hi,

https://github.com/JWarmenhoven/weewx

Is there any interest in me making this into a proper extension?
I mostly use Python interactively for data analysis in Jupyter Notebooks, so I will need to have a look at the docs and existing extensions in the wiki to see how it is done :-)

/Jordi

Vince Skahan

unread,
Apr 18, 2016, 9:33:03 AM4/18/16
to weewx-development
On Monday, April 18, 2016 at 4:02:23 AM UTC-7, jordi.wa...@gmail.com wrote:
https://github.com/JWarmenhoven/weewx

Is there any interest in me making this into a proper extension?


I think it would be a pretty slick thing to make available if you have time.
I could see an overlay on top of a satellite image of the house as  something I'd think of adding to my setup.

adaco...@gmail.com

unread,
Oct 10, 2017, 6:01:21 PM10/10/17
to weewx-development
I have a special project I am working on that can use your runway wind plot extension. I have it working with the simulator data but there are two things I can't seem to resolve. The first is that the arrow is too long. It basically runs top to bottom on the overlay image. I need it at least 50% smaller. It's also quit narrow and would like to change it to be wider (see attachment). The second issue I have is that I don't need the text output at the top of the screen. It's not needed in my application. How do I remove that? Below is the skin.conf I am using to generate the index.html. I looked in the RWYplotGenerator.py to try and find an answer there also but I don't see anything that stands out. Nice work by the way.

[RWYplotGenerator]
  input_image = /home/weewx/skins/airshow/Runway1.png   # Enter path to input image
 
  output_image_dpi = 200
  output_image_arrow_color = red   # http://matplotlib.org/api/colors_api.html
  output_image = /home/weewx/skins/airshow/Runway.png  # Enter path to output image
  output_image_fontsize = 12
  output_arrow_xpos = 107   # (pixel coordinates) You will need to adjust this to place the
  output_arrow_ypos = 91  # arrow on a specific location on the input image. Top left = (0,0)
Runway.png

Vince Skahan

unread,
Oct 11, 2017, 8:37:56 AM10/11/17
to weewx-development
On Tuesday, October 10, 2017 at 3:01:21 PM UTC-7, adaco...@gmail.com wrote:
I have a special project I am working on that can use your runway wind plot extension. I have it working with the simulator data but there are two things I can't seem to resolve. The first is that the arrow is too long. It basically runs top to bottom on the overlay image. I need it at least 50% smaller. It's also quit narrow and would like to change it to be wider (see attachment). The second issue I have is that I don't need the text output at the top of the screen. It's not needed in my application. How do I remove that? Below is the skin.conf I am using to generate the index.html. I looked in the RWYplotGenerator.py to try and find an answer there also but I don't see anything that stands out. Nice work by the way.


Look between lines 59 and 70 in the file.

Looks like line 61 prints the title.  Try commenting it out.   Line 69 has the width specification.  Try making that number bigger.

adaco...@gmail.com

unread,
Oct 11, 2017, 6:37:19 PM10/11/17
to weewx-development
I figured out commenting the Set title block after I posted yesterday. Now no text.

I have changed line 69 "width=" all the way up to 10.0 and the arrow line width width doesn't change. I attached a screen grab of the project. Get over this hump and it's smooth sailing I hope. Going to use the Airmar 150mx so that will be the next hurdle.


On Saturday, April 12, 2014 at 4:18:31 PM UTC-5, jordi.wa...@gmail.com wrote:
Airshow Project.PNG

James Shannon

unread,
Oct 12, 2017, 3:36:33 PM10/12/17
to weewx-development
One thing to note is that code doesn't seem to do any conversion for magnetic deviation. Instructions I've found say that (acurite) wind sensors should be installed with reference to true north (though I imagine this isn't always the case). OTOH, runways are in magnetic, so the conversion needs to be done. OTOH, now that I look at the code they don't seem to be calculating the deviation from rwy heading (or the xwind component), but instead just plotting the vector.
Reply all
Reply to author
Forward
0 new messages