Configuration

Configuration of pyAutoFuzSlpPos project.

@author: Liangjun Zhu

@changelog: - 15-07-31 lj - initial implementation. - 17-07-31 lj - reorganize as basic class, and incorporated with pygeoc.

class autofuzslppos.Config.AutoFuzSlpPosConfig(cfg_parser, bin_dir=None, proc_num=-1, rawdem=None, root_dir=None)[source]

Bases: object

Get input arguments for pyAutoFuzSlpPos main program and
parse configuration file (*.ini file).
bin_dir

Required. Executable binary file path.

ws

Derived from inputs. Workspace directories, see also CreateWorkspace.

dem

Required. Input dem of study area. Be caution! DEM file should have one cell buffer of the desired extent, e.g., watershed boundary. If flag_PreProcess is set to False, dem can be None.

mpi_dir

Optional. MPI binary path. If it has been exported to the environmental path, set as None.

hostfile

Optional. The hostfile is a text file that contains the names of hosts, the number of available slots on each host, set to None if not stated.

outlet

Optional. Watershed outlet as ESRI shapefile. Be caution! The outlet point should locate at least one cell inner the DEM boundary. If outlet is None, the maximum of Contributing Area will be identified as outlet.

valley

Optional. Vally source as raster file. If not provided, set None.

ridge

Optional. Ridge source as raster file. If not provided, set None.

regional_attr

Regional topographic attributes, decrease from ridge to valley, range from 1 to 0, e.g., RPI (Relative Position Index, Skidmore, 1990)

flag_preprocess

Preprocess for terrain attributes? True is default, if false, topographic attributes used for fuzzy inference must be existed in ‘Params’ dir.

flag_selecttyploc

Select typical locations automatically? True is default, if false, typical locations of each slope position must be existed.

flag_auto_typlocparams

Automatically determine the parameters for typical locations? True is default, if false, the script will find these parameters from the *.ini configuration file, and/or the XXXExtConfig.dat file in ‘Config’ directory. Exception will be raised if all tries failed.

flag_fuzzyinference

Calculate fuzzy membership of each slope position? True is default.

flag_auto_inferenceparams

Automatically determine the parameters for fuzzy inference? True is default, if false, the script will find these parameters from the *.ini configuration file, and/or the XXXInfConfig.dat in ‘Config’ directory. Exception will be raised if all tries failed.

flag_log

Write runtime log information to files. True is default.

selectedtopo

Topographic attributes used for AutoFuzSlpPos. The key is attribute name, and value is full file path. See also topoparam.

extractrange

Extract value ranges for each topographic attributes of each slope positions. {SlpPosType: {regionalAttr: [minv, maxv], ...}}

inferparam

A Directory to store fuzzy inference parameters, the basic format is: {SlpPosType: {regionalAttr: [FMFShape, w1, r1, k1, w2, r2, k2], ...}}

See also

Nomenclature.CreateWorkspace

static check_file_available(in_f)[source]

Check the input file is existed or not, and return None, if not.

read_flag_section(_flag)[source]

read executable flags

read_optional_section(_opt)[source]

read and check OPTIONAL inputs.

read_optionaldta_section(_optdta)[source]

Optional parameters settings of digital terrain analysis for topographic attributes

read_optionfuzinf_section(_optfuzinf)[source]

Optional parameter-settings for Fuzzy slope position inference.

read_optiontyploc_section(_opttyploc)[source]

Optional parameter-settings for Typical Locations selection

read_required_section(_require)[source]

read and check required section

autofuzslppos.Config.get_input_cfgs()[source]

Get model configuration arguments.

Returns:InputArgs object.