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.
ETA 1998-06-29 00:00
data source.
ETA 1998-06-29 12:00
data source, so we have
two output times from the Eta model, 12 hours apart.
Field Selector
, select
Formulas
in the
Data Sources
panel. Click on the
Miscellaneous
tag in the Fields
panel
Simple difference a-b
,
then click on Edit Formula
in the popup menu.
The Formula Editor
appears.
(For more see
Formula Editor).
Cancel
in the Formula Editor
.
Displays
panel expand the Plan Views tab and click on
Contour Plan View
, then click on
Create Display
.
Field Selector
window appears that allows you to select which actual
parameters from a data source or sources you want to use
for each variable in the formula.
You can select parameters from more than one data source
for use in this single formula.
Field Selector
window:Eta 1998-06-29 12:00 -> 2D Grid -> mean sea level pressure (Eta model reduction)
For the "b" operand choose:
Eta 1998-06-29 00:00 -> 2D Grid -> mean sea level pressure (Eta model reduction)
OK
.
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.
Edit->Formulas->Create Formula
.
The Formula Editor
window appears.
Name
windspeed
(one word - no space).
Formula
entry field. The formula is
sqrt(u**2 + v**2)
Advanced
panel.Description
wind speed from u and v
.
Group
enter Workshop
.
Displays
section, click the
Use selected
radio button, then click
the All off
button.
Plan Views
category and
check the Contour Plan View
option. Also, expand
the 3D Surface
category and check the
Isosurface
option.
Add Formula
.
wind speed from u and v
should appear in the
Field Selector
window's Fields
panel, under
Workshop
.
12:00 Z Eta
data source to use the first three times,
with the Field Selector
window.
(see
Selecting Times).
wind speed from u and v
item in the
Fields
panel under the Workshop
group.
Displays
panel click on
Contour Plan View
, then click on
Create Display
.
Field Selector
window: Eta 1998-06-29 12:00 -> 3D Grid -> u component of wind
For the "v" operand choose:
Eta 1998-06-29 12:00 -> 3D Grid -> v component of wind
OK
.
Levels
selector to change the wind display
level to 250 hPa.
Eta 1998-06-29 12:00
choose the parameter
3D Grid -> Derived -> Windspeed (from Gridrelative_u and Gridrelative_v)
Make a Contour Plan View of this wind speed automatically derived by the IDV.
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.