1.1. What is Jython?
A.
Jython is a Java implementation of the Python language. It is used within the IDV for data analysis.
Complex routines can be written in the IDV Jython editor and called from the
IDV Formulas.
1.2. How do I learn to write Jython?
A.
There are a
number of books available on the language as well as a number of web sites:
1.3. How does Jython work with my data in the IDV?
1.4. I don't like editing in this editor. How do I use my own editor?
A.
You can use this edit window or,
optionally you can define the path to an external text editor (e.g., emacs, vi, etc.)
through the main
User Preferences. Once defined there will be a File menu entry
in the Jython Library "Edit in External Editor". The file that is being edited is monitored by the IDV
and, when it is saved by the external editor is loaded and checked for correct syntax. When the external editor exits
the file is reinserted into the internal IDV editor.
When you save the file thought the external editor or the IDV editor the code is checked
for valid Jython syntax; If there is an
error, a pop-up window will appear with an error message.
The actual error will also be printed in the console window running the IDV. Correct the error and
try to save again.
1.5. Creating/Removing library files
A.
To create a new file uses the menu. To remove the currently displayed
library file use the menu.
1.6. Calling procedures from formulas
A.
When creating a formula with the
Formula Editor
you can call any routines you have defined in the Jython Library
Simply enter the procedure name in the formula, with
appropriate arguments, if any. For example a formula might be
"convertCToF(atemp)". When evaluating the formula for display,
this will call the routine that you define in the Jython Library.
1.7. Create a formula from my procedure
A.
Right click on a procedure definition within the IDV editor window and choose
. This is a convenience that brings up
the Formula creation dialog with a call to that procedure.
Also, as another convenience you can right click to show the menu. This
lists all of the currently defined procedures in the other Jython libraries.