Previous: Jython Methods Next: Doing More with Jython Table of contents Frames User guide
Unidata IDV Workshop for version 3.0u2 > Advanced Topics > Diagnostic Functions: Formulas and Jython

4.2.2 Doing More With Formulas

Formulas can be used to do simple arithmetic such as the simple difference, or they can be used to call Jython procedures as in the previous excercise. They can also be used to call Java methods and nest Jython procedures. In this exercise, we will show how to create more complex formulas from the set of diagnostic functions in the IDV.

First review Basics of IDV Formulas.

  1. Calculating the ageostrophic wind
    • Clear all displays and data.
    • Load in the ETA 1998-06-29 00:00 data source. Show popup
    • Create the following displays:
      • 500 mb contours of geopotential height
      • 500 mb flow vectors of grid relative winds. Set the skip interval to 2 and the range to be -30 to 30. Save the display settings as Workshop->Flow fields.
      • 500 mb flow vectors of the geostrophic wind. Use the display settings saved in the previous step.
    • The ageostropic wind is the difference between the geostropic wind and the actual wind.
        AGEO = OBS - GEO
    • We could simply create a formula that is OBS - GEO and select the flow vector field and the geostropic wind. For this exercise, we will look at how we can do this from the basic fields, on the fly.
    • Open the Jython Library and look at the System->Grid Diagnostics library. This is a set of diagnostic functions that can be applied to grids. The names closely match the set of grid diagnostics in GEMPAK. Look at the page in the Jython Libraty section of the User's Guide.
    • From the Formulas Data Source, select the Grids->Define a grid diagnostic formula.
    • Select the Flow Displays->Vector Plan View, the Workshop->Flow fields display setting and create the display.
    • You will be prompted for the formula. In the dialog, type in:
         vsub(vecr(u,v),geo(z)) 
      This will take the vector difference (vsub) between the vector (vecr) defined by u and v components and the geostrophic wind (geo) calculated from the geopotential height field (z).
    • Click the OK button.
    • For the fields, select the u and v wind components and the geopotential height for u,v and z respectively. Select the 500 hPa level for each of the grids.
    • Zoom in to see the detail of the plots.
  2. Calculating the magnitude of the ageostrophic wind

 


Previous: Jython Methods Next: Doing More with Jython Table of contents Frames User guide
Unidata IDV Workshop for version 3.0u2 > Advanced Topics > Diagnostic Functions: Formulas and Jython