Please Note: Some of the APIs described below will likely change in the coming months!
To start with, here is an example Python script.
Scripting in Jython allows for flexibility and a more "programming" flavor for IDV scripting, though you can still do much of the functionality using Jython that you can do using ISL. The benefit of the ISL is that it is more declarative and requires (hopefully) less knowledge of programming.
To run the IDV with a Jython script, do:
runIDV -islfile your-script.py
Below, each of the available methods in the Jython scripting interface will be described.
The parameters variable is a string that contains any parameter information (see the ISL description of parameters) It is in the form:
"clip north=40; matte background=green top=20; resize height=300 width=300"
The quality value is 1.0 for the best, down to 0.0 for, well, no quality at all...
The parameters variable is a string that contains any parameter information (see the ISL description of parameters) It is in the form:
"clip north=40; matte background=green top=20; resize height=300 width=300"
def exampleSubsetting(): #Create a data source dataSource = makeDataSource("ruc.nc") #Find the temperature dataChoice dataChoice = dataSource.findDataChoice("T") #create a DataSelection dataSelection = DataSelection() #Set both the x and y stride on it dataSelection.setXYStride(5); #Note: you can also do: #dataSelection.setXStride(5); #dataSelection.setYStride(5); #dataSelection.setZStride(5); #Set the spatial bounds. This takes north, west, south, east dataSelection.setBounds(45,-120,40,-100) #create a list of times and add an integer 0 to it #This says use the first time times = ArrayList() times.add(Integer(0)) dataSelection.setTimes(times) #Set the level to use. For example, this is the 5th level (they are 0 based) dataSelection.setLevel(Integer(4)) #Now get the data and create the display tempField = dataSource.getData(dataChoice, None,dataSelection,None) createDisplay('planviewcolor', tempField,"T") subset.py