[Go to Previous] [Go to Next]


Scripting

McIDAS-V can be scripted to create and manipulate images and movies. The scripting is accomplished using Jython. Jython is an implementation of the Python language in Java and follows Python syntax.

McIDAS-V scripting can be done from the Jython shell, or a Jython script can be invoked as a command line argument.

In Unix, from the McIDAS-V-System directory:

   runMcV -script /home/user/example.py 
In Windows, from the McIDAS-V System directory:
   runMcV.bat -script C:/Users/user/example.py 

Users can pass arguments through scripts at runtime with the scriptargs flag, which uses uses standard Python optparse/argparse syntax within the script to specify the arguments. Anything after the scriptargs flag will be considered a scripting argument, so scriptargs should be specified last. For example, if a script is set up to allow a user to pass through a band number with "--bands", the script can be run in the following way to request band 8 (Unix and Windows examples):

   runMcV -script /home/user/example.py -scriptargs --band 8
   runMcV.bat -script C:/Users/user/example.py -scriptargs --band 8

When invoked as a command line argument, the user interface will not be shown. However, McIDAS-V still needs to be run with an active window system (e.g., X, MS Windows) for it to run. If running under a Linux/Unix machine with no X server running, McIDAS-V must be run under the X virtual frame buffer, xvfb.


McIDAS-V supports a number of functions and methods to load and display data, manipulate the display, and to save images. Download the example script to see how to use each one (example18.py). This page contains a list of functions that are supported in McIDAS-V. You can find more information about each function, including parameters, keywords, and example commands, by clicking on a function or a function category.

Create an Object:

Create an Object - Imagery:

Create an Object - Grids:

Modify the Display Object: Modify the Layer Object: Modify the Layer Object - Point: Data Analysis: Save the Display: Environment:

For users looking for more functionality from McIDAS-V scripting, additional functions can be found in the Java docs for visAD, netCDF, IDV, and McIDAS-V. Please send any questions or requests for functionality to the McIDAS-V Support Forum on scripting.


[Go to Previous] [Go to Next]