[Go to Previous] [Go to Next]


Jython Methods

McIDAS-V allows you to write your own Jython methods using the Jython Library editor. From the main menu bar, select the Tools->Formulas->Jython Library menu item in the Main Display window.

Image 1: Jython Libraries Window
Image 1: Jython Libraries Window

The Jython Library window has a tree view on the left that shows the different (categorized) library files available. The files that are listed under "Local Jython" are those that you can edit. The System files should not be edited by the user, and you should contact the McIDAS Help Desk for assistance if you wish to modify them. On the right is the edit panel for the selected file.

There is documentation available for the System Jython Libraries.


FAQ

Q. What is Jython?

A. Jython is a Java implementation of the Python language. It is used within McIDAS-V for data analysis. Complex routines can be written in the McIDAS-V Jython editor and called from the McIDAS-V Formulas.

Q. 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:

Q. How does Jython work with my data in McIDAS-V?

A. McIDAS-V uses the VisAD package as as an underlying data model. There is a VisAD/Jython Tutorial available.

Q. Creating/Removing library files

A. To create a new file use the File->New Jython Library... menu. To remove the currently displayed library file use the File->Remove Library menu.

Q. 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.

Q. Create a formula from my procedure

A. Right click on a procedure definition within the McIDAS-V editor window and choose Make formula for .... This is a convenience that brings up the Formula creation dialog with a call to that procedure.

As another convenience you can also right-click on the Formula: field of the Formula Editor to show the Insert Procedure Call menu. This lists all of the currently defined procedures in the other Jython libraries.


[Go to Previous] [Go to Next]