urclib.simple_simpa

Module Contents

Functions

_dtype_to_ctype(dtype)

Convert a numpy dType to a ctype.

_create_shim(rasters)

Create an empty dataset with the same attributes as the provided raster group. This dataset

simple_simpa(outpath, mult_rasters[, mproc])

Runs SIMPA method using pre-generated fuzzylogic python logic.

init_mproc(g_ins, g_outs)

process_mproc(index)

launch_mproc(in_rasters, out_proto, fieldnames, ...)

urclib.simple_simpa._dtype_to_ctype(dtype)

Convert a numpy dType to a ctype.

Parameters:

dtype (str) – string of numpy dtype to match.

Returns:

The matching ctype.

Return type:

ctype

Raises:

KeyError – If inDType does not map to an existing ctype.

urclib.simple_simpa._create_shim(rasters)

Create an empty dataset with the same attributes as the provided raster group. This dataset can be used to act as a “shim” for components that do not have any data yet are to be included in the SIMPA analysis.

Parameters:

rasters (RasterGroup) – The group of Rasters to model the shim after.

Returns:

The raster to use as a nodata “shim”.

Return type:

gdal.Dataset

urclib.simple_simpa.simple_simpa(outpath, mult_rasters, mproc=False)

Runs SIMPA method using pre-generated fuzzylogic python logic.

The content of urc_fl is generated from URC_FL.sijn project file using the fuzzylogic package’s generate tool.

Parameters:
  • outpath (str) – Path to the outputs directory

  • mult_rasters (RasterGroup) – The rasters to include.

  • mproc (bool,optional) – If True run SIMPA in parallel using Python’s multiprocessing module. Defaults to False.

Returns:

Path to SIMPA outputs.

Return type:

UrcWorkspace

urclib.simple_simpa.init_mproc(g_ins, g_outs)
urclib.simple_simpa.process_mproc(index)
urclib.simple_simpa.launch_mproc(in_rasters, out_proto, fieldnames, out_nodata_val)