[Go to Previous] [Go to Next]


Create an Object

buildWindow - Creates a window and returns an array of panels (single panel currently supported)

Usage: panel=buildWindow(keywords)
Keywords - optional:
height= height of the window
width= width of the window
panelTypes= type of display to create
MAP (default)
GLOBE
MAP2D
widgets= include toolbar buttons in the window
True (default)
False
Example:
panel=buildWindow(height=600,width=800,panelTypes=GLOBE)
panel=buildWindow(height=600,width=800,panelTypes=MAP)
Remarks:
When widgets=False is passed through buildWindow(), there will be no toolbar buttons, including the top toolbar that allows for closing the window. There are two ways of closing this window within McIDAS-V. To do this, the findWindow() function (defined below) can be used, or a "with statement" can be used. When working in a foreground session, it is possible to build a window that will close itself once it has completed the process assigned to it using Python's "with statement" functionality. For example, a user can build a window, display a loop of satellite data, write a movie, then have the window close automatically when the movie capture is complete. Here is an example of how to use this functionality with buildWindow.
with buildWindow(height=1000,width=1200) as panel:
layer = panel[0].createLayer('Image Sequence Display',myLoop)
writeMovie('C:/Users/myUser/myMovie.gif')

createLayer - Creates a new data layer in a panel

Usage: myDataLayer = panel[0].createLayer(keywords)
Keywords - required:
display type= display type for layer; valid options shown in Field Selector (e.g. 'Image Display', 'Image Sequence Display')
myData= data object to display (from loadADDEImage)
Example:
layer=panel[0].createLayer('Image Display', data)

findWindow - Finds and creates a reference to the window containing a display

Usage: window = findWindow(display=panel[0])
Keywords - required:
display= display name defined from buildWindow
Remarks:
The buildWindow function returns a reference to a specific panel in a window, and therefore any functions run on this panel will only impact that one panel, not the window as a whole. This findWindow function returns a reference to the actual window containing the buildWindow panel. This allows for performing actions on the window itself, such as adding new tabs and closing the window.
Example:
panel = buildWindow()
window = findWindow(display=panel[0])
see(window) # return which functions/methods can be applied to 'window'
window.createTab()
window.close()

openBundle - Creates a new window and displays contents of a bundle

Usage: openBundle(keywords)
Keywords - required:
bundle file= file name of bundle
Keywords - optional:
height= height of display; default= height of the display window when the bundle was saved
width= width of display; default= width of the display window when the bundle was saved
dataDirectory= a dictionary where the keys are datasource names, and the values are either a string or list of strings representing the full path name/names of the data that will be used in place of the data in the bundle
mode= specifies the method that will be used to open the bundle
REPLACE - Removes any previously-loaded layers and data sources and replaces the current session with the bundle's data (default)
NEWWINDOW - Loads the bundle's data and displays into a new window, without removing any previously-loaded layers and data sources
MERGE - Loads the bundle's data and displays into the current tab of the active display window without removing any previously-loaded layers and data sources
NEWTAB - Loads the bundle's data and displays into a new tab of the active display window without removing any previously-loaded layers and data sources
Example:
openBundle('C:/Users/myUser/bundle.mcv',mode='NEWTAB')

[Go to Previous] [Go to Next]