7.3.2 Derived Data

The IDV uses the formula mechanism to automatically create
"derived" quantities based on the fields in a particular
data source. When the data source is read in, the list
of derived quantities is evaluated against the list of
variables in the data. Users can define their own
derived quantities by:
- Defining an IDV formula by name, description, and mathematical formula.
- Using special operators (D1, D2, ... DN) for the variable names.
- Specifying the binding between the special operators and the parameters names or system aliases.
- Saving the formula and loading or reloading a data source.

Create a formula select the `Edit->Formulas->Create Formula`

menu item. This brings up the **Formula Editor** dialog box
used to define a formula:

You can use the `Derived`

tab in the `Formula Editor`

to set the bindings between
formula parameters and fields/aliases. You need to check
the `Create derived quantities`

checkbox to enable
this as a system formula.

The parameters to be bound are denoted by operands D1, D2, D3, etc in the formula itself. If you need user input, you can use other field names and the users will be prompted to supply those fields.

You can define the bindings for the operands using parameter groups or
by specifying the parameters to use. Right clicking in the
`Parameter`

input field will pop up a menu that
allows you to select system parameter aliases or parameters from
fields loaded into the IDV already.

Categories specify the types of data that are allowed in this formula. For example, if your derived formula is valid only for 3D Grids, you can select that category from the popup list. Access the list by right clicking in the Categories input fields.

You can define specific output categories if the type of the data that the formula creates is different from the categories that the input operands require. In general, the output categories will be the same as the input categories. For more information on data categories, see the Formulas section.

To save the formula, click on **Add formula**.
A new entry appears in the Fields panel of the Field Selector.
If you want to apply the formula to an existing data source, you
need to reload that data source. Right click on the name of the
data source in the `Data Sources`

section of the
`Field Selector`

and select `Reload Data`

.