Menu

Using SAGA Modules Log in to Edit

Anonymous

General

SAGA ships with modules that can be executed in every environment (GUI, CMD, Python) and ones that are interactive and thus can be only executed in SAGA GUI. The latter require user interaction like drawing a profile line in a map view.

In general, each module is structured in an input data section, an output data section and an options sections used to specify the necessary parameters to run the module with. The input and output data is further subdivided in datasets required and datasets that are optional.

To perform calculations on several raster datasets at once, these must (in most cases) share the same grid system. I.e. these grids must have the same origin, cell-size and extent. In case you like to process raster datasets not fulfilling this requirement, you will first have to use one of the available modules to merge the datasets into one grid system (see Grid System Matching <link>). This may require merging, patching, resampling or reprojection of the datasets. The next sections give an overview on the general concepts you need to know to execute a module in the corresponding environment.


Executing Modules in SAGA GUI

The GUI provides two ways to access a module: the Modules menu and the Modules tab of the Workspace window. The selection of a module via the corresponding menu entry opens up a new dialog where you can do the necessary parameter settings. Selecting a module via the entry in the Modules tab allows you to enter the parameters directly in the Settings tab of the Properties window. It's a matter of choice which one to use. Using the Modules tab has the advantage that you can access information about the module via the Description tab of the properties window. There you will find information about the author of the module, references about the methods implemented and information about the parameters of the module.

The parameter dialog of the modules is split into a Data Objects section (further subdivided into grids, shapes and tables) for input and output datasets and an Options section with further parameters required by the module. The system of the Data Object section is as follows:

symbol
meaning

>>
mandatory input dataset

>
optional input dataset

<<
mandatory output dataset

<
optional output dataset

In case you use a module with grids as input, the first step is to select one of the available grid systems by left clicking in the right column of the corresponding parameter. As already stated, most modules require the input grids within the same grid system. Additionally it is necessary, that the input grids are loaded. Next you can select the grids available in the chosen grid system by left clicking in the right column of the parameter dialog. This will change the text from [not set] to the name of the selected dataset. Besides selecting single datasets, some modules (e.g. the Grid Calculator module) allow to select several grids at once via a Grid List. Left clicking in such a column opens up a new dialog, where you see the available input datasets on the left and the ones you selected on the right.

The mandatory output datasets are set to [create] by default. But this is changed once you have executed the module: the next time you use the module, the output datasets are set to the previously created grids. So if you don't like to overwrite your previously created datasets, you have to select [create] again.

In some cases (e.g. the data import modules) you will find that you don't need to specify a grid system and the datasets within it, but an input file. Left clicking in the right column of the Properties window will open up a file dialog to specify the file.

In general, the shapes and table Data Objects sections work much the same. Once you had a look at the grid section, you will discover no problems with these.

Within the Options section you have to set the module parameters to match your needs. If you left click into the right column of a parameter, you will be able to either enter text, select from a choices list or use a checkbox to set a parameter to true or false.

Once you altered a setting in the Properties window, you can apply it with the Apply button. This will make SAGA remember your settings in case you switch to another dialog in the meantime. You can save your settings with the Save button or load previously stored settings with the Load button.

Last but not least, you can execute the module with the Execute button. Have a look at the Messages window to see if the module was executed successfully. There are three tabs in this window (General, Execution and Errors) that will give you detailed information about what might happened.


Executing Interactive Modules in SAGA GUI

Interactive modules require user interaction like selecting a grid cell or drawing a profile line. To allow this, interactive modules keep running once you execute them. This allows you to select the Arrow tool and perform some action within the map view. To stop a running module, you have to press the Execute button again or select the module from the menu again. Take the Change Cell Values (Interactive) module as an example: Display the grid you like to alter by double clicking on the dataset in the Workspace window. Now open the module's parameter dialog and select the grid system and the grid. Set the value you like to assign to some grid cell in the Options section and execute the module. Now zoom to the desired extent and select the Arrow tool. Once you left click a grid cell, you assign it the new value. To stop the module, press the Execute button again.


Executing Modules in SAGA CMD

- under construction -


Executing Modules with the Python Interface

- under construction -


Related

Wiki: Binary Packages
Wiki: Climbing Mount St. Helens
Wiki: Grid - Calculus module library
Wiki: Grid - Tools module library
Wiki: The Philosophy of SAGA

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.