Edit→Formulas→Jython Library
to bring up the Jython Libraries Editor
The Jython Library window has two or more panes selected by the tabs at the top. Only the "User's Library" is editable; the others came from the site path and system defaults.
How to Edit in the Jython Library
and for more info see
How to write a Jython Method
and
Jython Methods and the IDV
Jython libraries Editor, click on the tab
User's Library
def windSpeed(u,v):
""" compute wind speed from u and v
wind components """
usqd= u*u
vsqd= v*v
ws = sqrt(usqd + vsqd)
return ws
Save to check for correct Jython syntax
and save the method;
you will get an
error message if the syntax is not correct.
If it is complete, your method is saved.
File→Close menu to exit the editor.
Edit→Formulas→Create Formula.
The Formula Editor window appears.
Name jythonWS.
Formula entry field, simply
windSpeed(u,v).
Advanced panel by clicking on the down arrow.
Description
"jython wind speed".
Group select Workshop from the
drop down list.
Displays section, click on
Use selected and then the All off
radio button. Then select Contour Plan View and
Contour Vertical Cross Section in the list.
Add Formula.
jython wind speed
should appear in the
Field Selector window's Fields panel, under
the Workshop category.