Previous: Interactive Scripting with the IDV and the Jython Shell Next: Configuring IDV Sites Table of contents Frames User guide
Unidata IDV Workshop for version 6.3 > Advanced Topics > Scripting with IDV

4.3.6 Batch Scripting with the IDV Jython API
IDV Jython scripting to visualize data in batch mode

In addition to interactive scripting, Jython scripts can run in batch mode for automatic generation of images without necessarily having to "manually" invoke an IDV client GUI. These scripts can be useful for generating images via a crontab, for example. Note that when developing your Jython IDV batch script, it is useful to first experiment with them in interactive mode. See the previous section about the Jython interactive shell.

  1. In your favorite editor, create a file call script.py and add the following code
    setOffScreen(1)
    idv.getStateManager().setViewSize(java.awt.Dimension(800,600))
    ds = makeDataSource("dods://motherlode.ucar.edu:8080/thredds/dodsC/casestudies/idvtest/grids/small_ruc_grid.nc","netcdf.grid")
    temp = getData(ds.getName(),"T")
    dc = createDisplay('planviewcolor',temp)
    pause()
    image = getImage()
    writeImage('/home/idv/isl/image.png')
    
  2. Now run that script with the following command
    runIDV -islfile script.py
    

 


Previous: Interactive Scripting with the IDV and the Jython Shell Next: Configuring IDV Sites Table of contents Frames User guide
Unidata IDV Workshop for version 6.3 > Advanced Topics > Scripting with IDV