Previous: WRF Grid Displays Next: WRF Analysis: Derived Products and Advanced Features Table of contents Frames User guide
Unidata IDV Workshop for version 6.3 > Accessing and Displaying Data > Working with WRF Output > Interactive

3.13.0.3 WRF Analysis: Formulas
Formulas in the IDV
Built-in Forumlas

The IDV is not only a data visualization package, but it is also a powerful analysis package. The IDV has several built-in functions that range from very simple operations, such as negating a field (that is, changing the sign of all of the values on the grid), to more complex operations, such as computing the horizontal flux divergence field. These built-in operations can be accessed through the Field Selector tab by clicking on Forumlas in the Data Sources side panel.

As an example, let's use a formula to compute the 500 mb - 850 mb wind speed shear:


  1. Clear any existing displays by clicking the red and white eraser symbol found just below the Main Menu bar on either the Dashboard to Main View window.
  2. Make sure your WRF ouput is loaded.
  3. In the Field Selector panel, select Formulas from the Data Sources panel and click Grids→Layer Wind Shear, then select Color Filled Contour Plan View as the display and click Create Display.

The IDV will prompt you for which levels you would like to calculate the shear between (top and bottom), and the fields (u, v, and z) needed to compute the layer shear.

  1. For field u, expand the data source for your WRF output and select the 3D grid→u_wind @ isobaric field.
  2. For field v, expand the data source for your WRF output and select the 3D grid→v_wind @ isobaric field.
  3. For field z, expand the data source for your WRF output and select the 3D grid→Geopotential_height @ isobaric field.
  4. Click the Create Display button.
Adding Custom Functions

Formulas in the IDV are defined using Jython, which means extending the analysis capabilities of the IDV can be done by adding new Jython functions (much easier than editing the IDV Java code!) As an example, let's add a Jython formula to compute wind speed (although one already exists, it's still a good exercise to go through):

  1. Remove all displays.
  2. From the main menu, click on Edit→Formulas→Create Formula. The Formula Editor window should appear.
  3. Enter the Name of your forumla: windspeed (one word - no space).
  4. Enter the mathematical formula definition in the Formula entry field using the Jython syntax. The formula is
  5. Open the Advanced panel in the Formula Editor.
  6. Enter a Description for the forumula: wind speed from u and v.
  7. For Group enter Workshop.
  8. Now we will tell the IDV which display types our formula can use:
  9. Click on Add Formula.

A new item wind speed from u and v should appear in the Field Selector window's Fields panel, under Workshop. We've only touched on the basics of the use of formulas in the IDV - please see the IDV Formulas for more details.

 


Previous: WRF Grid Displays Next: WRF Analysis: Derived Products and Advanced Features Table of contents Frames User guide
Unidata IDV Workshop for version 6.3 > Accessing and Displaying Data > Working with WRF Output > Interactive