- See also
- python.workflows._module
Aim of module
Generic script for batch execution of any OPALS module with multiple input files.
General description
Many processing tasks require applying the same OPALS module, using identical parameter settings, to a series of input files. While dedicated scripts exist for several OPALS modules (their names always start with an underscore followed by the module name, e.g. _import.py, _grid.py, etc.) and are typically used within the main workflow scripts, the generic _module script provides a more flexible solution. It allows users to execute any OPALS module on individual input files without explicitly implementing a loop over a file list, thereby simplifying batch processing tasks. The example section show how to use the script with Module Import and Module Info.
Parameter description
-module determine which module to run with multiple input files
Type : String
Remark : mandatory
-suffixOutfile optional suffix/extension for modules that provide an outFile parameter, typically indicating the written file format
Type : String
Remark : optional
Common Package/Script Options
Settings concerning the general options for (package) scripts.
-infile input text file, directory or strip file
Type : Path
Remark : mandatory, default: ['strip*.laz']
Description: As input either the name of an ASCII file (extension .txt) containing the names of the data files (one file per line) or an expression using wildcards to specify the respective data sets are accepted.
-outfile output directory or settings file (.txt)
Type : Path
Remark : optional
Description: Specifies the directory where the final results are stored. If not specified, the results are created in the current working directory.
-tempdir temporary directory
Type : Path
Remark : optional, default: current directory
Description: Specifies the directory where all intermediate results are stored. If not specified, a TEMP subdirectory is created in the current working directory. Additional subdirectories (one per involved module) are created.
-cfg Path to configuration file
Type : Path
Remark : optional, default: $OPALS_ROOT/cfg/_module.cfg
Description: The name of a configuration file containing all relevant calculation parameters is expected. If not specified, the default cfg files as provided by the OPALS distribution are used.
-projectDir project directory
Type : Path
Remark : optional, default: current directory
Description: The default project directory is the current working directory, but can be easily changed by this parameter. All path parameters, if not specified as absolute paths, are interpreted relative to the project directory.
-skipIfExists skip processing if result already exists
Type : Boolean
Remark : optional, default: True
Description: Skip processing if result already exists. In order to re-run current script it is useful to repeat the processing only if the respective output does not already exist. This allows for incremental processing of large projects.
| possible input | evaluates to |
| 1, true, yes, Boolean(True), True | Boolean(True) |
| 0, false, no, Boolean(False), False | Boolean(False) |
-distribute determine how many local processes should be used
Type : String
Remark : optional
Description: according to the number chosen as the value, independent processes are being started to parallelise (parts of) the program and therefore enhance the runtime.
Logging Options
Settings concerning the verbosity level of logging.
-fileLogLevel Log level in the logfile
Type : LogLevel
Remark : optional, default: info
-screenLogLevel Log level on screen
Type : LogLevel
Remark : optional, default: info
-logger Logger
Type : Logger
Remark : optional
Description: Logger is usually provided by the opals framework.The user may provide their own logger object, but it has to function in the same way as the opals Logger.
Output Options
Read only parameters that can be accessed via python after the script was run
Examples
The data used in the following examples can be found in the $OPALS_ROOT/demo/ directory.
Example 1: opalsImport
The following command performs opalsImport on all input files one after another.
opals _module -inf
strip*.laz -cfg _moduleImport.cfg -module Import
Example 1: opalsImport
The second examples computes overview matrices of the odm files using opalsInfo. You can use -distribute for multicore processing.
opals _module -inf
strip*.odm -cfg _moduleInfo.cfg -module Info -distribute 6