Previous: Diagnostic Functions: Formulas and Jython Next: Jython Methods Table of contents Frames User guide
Unidata IDV Workshop for version 6.3 > Advanced Topics > Diagnostic Functions: Formulas and Jython

4.2.0 Basics of IDV Formulas

Formulas in the IDV are one-line mathematical expressions to derive new values from data available.

The IDV comes with some Formulas. Here is an example of using one.

  1. Using an IDV System Formula
  2. Requesting the Formula to be Computed and Displayed
  3. You can make your own formulas. Your formulas are saved so you can build a library of your own derived quantities, using data you have.

  4. Creating a new formula for wind speed from u and v wind components
  5. Sub-setting times in the data source
  6. Requesting the new Formula to be Computed and Displayed
  7. Compare to the IDV's derived wind speed
  8. Extra - Calculate a difference between the system derived wind speed and the wind speed from your local formula using the simple difference formula. What would you expect the result to be? Answer Show popup
Notes on formulas

The Description is listed in the Field Selector's Fields panel. If you leave the Description field empty, the name of the formula will be used as the description.

Group is a way of categorizing your formulas and is optional. If the Group does not already exist, it is added when you save the new formula. If the Group already exists, the new formula will appear under that group's tab in the Field Selector's Fields panel. If you leave the Group empty, the formula appears in the list directly.

The variable names in the formula definition, such as dpt, are dummy names, and in principle can be anything, such as "a" or "var2". It is best to use variable names that suggest the parameter data they represent so that later in the parameter selection step you remember what the variables should represent. Use names like Temp500m, RelHum_surf, absvort, sst_jan, or whatever makes sense to you. If you use a variable names like V1 and V2, then later when the formula requests which real parameter name goes with which dummy variable name you may be puzzled.

Once you have defined a formula, it is saved and will appear in future runs of your IDV. It is saved in your personal copy of the derived.xml file, which usually is in the file ~/.unidata/idv/DefaultIdv/derived.xml on UNIX systems.

Holding the mouse pointer stationary over the formula name in the Field Selector's Fields panel will cause a tooltip box to appear showing the formula name and the mathematical formula.

Formulas are preserved by the IDV. Next time you start the IDV you will see formulas you created before. You can build up a library of your own formulas.

To remove a formula, click on Remove formula in the Field Selector's formula pull down menu. This does not remove a display of calculations made with a formula, it removes the formula itself from the Field Selector window. Usually you leave formulas in place until you are sure you will not use them again.

 


Previous: Diagnostic Functions: Formulas and Jython Next: Jython Methods Table of contents Frames User guide
Unidata IDV Workshop for version 6.3 > Advanced Topics > Diagnostic Functions: Formulas and Jython