[Go to Previous] [Go to Next]


Environment

getJythonShellMaxHistoryLength( ) - Returns the current number of commands that are saved.

Usage: print getJythonShellMaxHistoryLength()

setJythonShellMaxHistoryLength( ) - Sets the number of commands that will be saved.

Usage: setJythonShellMaxHistoryLength(number)
Remarks:
This is the number of commands that will be listed out with the File>List Saved History menu item in the Jython Shell, as well as the number that will be added to the Local Jython Library from the File>Save Commands to Jython Library menu item. The default number of commands saved to the history is 100.
Example:
setJythonShellMaxHistoryLength(25)

collectGarbage( ) - Performs a garbage collection to free up memory.

Usage: collectGarbage()

removeAllData( ) - Removes all data sources added during the current session, without removing any displays.

Usage: removeAllData()

removeAllLayers( ) - Removes all layers that have been displayed.

Usage: removeAllLayers()

expandpath( ) - Expands the path entered.

Usage: expandpath(path)
Remarks:
Understands environmental variables such as "~" and "..".
Example:
print expandpath('$HOMEPATH')

editFile( ) - Pastes the content of a text file into the text input field of the Jython Shell.

Usage: editFile(path)
path - Directory path to the file to be added to the Jython Shell.
Remarks:
Pastes the text of an existing file into the text input field of the Jython Shell. This makes it easy to evaluate and edit scripts.
Example:
editFile('C:\\Users\\myuser\\myscript.py')

getLogLevel( ) - Sets the logging level to be used by McIDAS-V.

Usage: print getLogLevel()
Remarks:
Returns the current logging level being used by McIDAS-V. This is composed of two items, level and effectiveLevel.
level- The logging level of the directory path used in the command. If a directory path is not specified, this is the logging level for the session as a whole.
effectiveLevel- The logging level for the specific module specified in the command
Example:
print getLogLevel( )
This returns the logging level for everything as long as a logging level for another directory hasn't already been set.

setLogLevel( ) - Sets the logging level to be used by McIDAS-V.

Usage: setLogLevel(level,keywords)
level- Logging level to be used. This can be set to TRACE, DEBUG, INFO, WARN, ERROR, or OFF. Information about each of these logging levels can be found in the Advanced Preferences page.
Keywords:
temporary= determines if the logging level will be saved from session to session (default = True)
Remarks:
This command can be used to set the logging level for the session as a whole, and it can also be used to set logging levels for specific directories to control what type of logging output goes to mcidasv.log.
Examples:
setLogLevel('TRACE')
Sets the logging level for everything to Trace as long as a logging level for another directory hasn't already been set.
print getLogLevel()
Returns the global logging level in McIDAS-V.  Both level and effectiveLevel are set to TRACE.

importEnhancement( ) - Imports a local enhancement file. This enhancement will then be available for use in a script as well as through the Color Table Editor in the current and future McIDAS-V sessions.

Usage: importEnhancement(filename,keywords)
Keywords - required:
filename= full path and file name of the local enhancement file
Keywords - optional:
name= name of the enhancement; default = the base filename without the extension (e.g. 'cape.xml' will become 'cape')
category= the category that the enhancement will be saved under. This name is used in the Color Table Editor under the Color Tables menu and allows for organization of enhancements; default= 'Basic'.
overwrite= sets if the command will overwrite any previously-existing enhancements with the same name. When set to False, an additional enhancement will be added to the list of color tables, and the name will be appended with '_#'. For example, if an enhancement named 'cape' already exists and an importEnhancement() command is run with the name specified as 'cape' and overwrite set to False, then the new enhancement will be saved with a name of 'cape_1'. If set to True, then the existing enhancement will be overwritten with the new one; default= False
Remarks:
The list of supported enhancement formats with importEnhancement() is the same as what can be imported through the Color Table Editor: If the enhancement specified in the filename keyword of importEnhancement() was originally exported from McIDAS-V, then the name and category keywords will be set from the values that already exist in the enhancement file.
Example:
importEnhancement(filename='C:\\Users\\myuser\\cape.xml', name='CAPE', category='Severe')

see( ) - Inspects an object passed through the function and prints out a list of different functions that can be used on the object.

Usage: setLogLevel(keywords)
Keywords:
obj= data or layer object passed through the function. The returned functions can be applied on the obj object.
pattern= filters the list of commands returned from the function. Wildcards (*) can be used.
Remarks:
If the obj keyword is omitted, the command will list all of the functions and packages that can be used in the current session.
Examples:
see(obj=data,pattern='.get*')
Returns a list of functions beginning with ".get" that can be applied on the data object.

[Go to Previous] [Go to Next]