com4FlowPy.com4FlowPy

com4FlowPy main function mainly handling input of data, model params and output of model results

Functions

checkConvertReleaseShp2Tif

function checks if release area is a .shp file and tries to convert to tif in that case

checkInputLayerDimensions

check if all input layers have the same size and can be read from the provided paths

checkInputParameterValues

check if the input parameters alpha, uMaxLimit/ zDeltaMaxLimit, exponent are within a physically sensible range

com4FlowPyMain

com4FlowPy main function performs the model run and writes results to disk:

defineNotAffectedCells

define not affected cells as -9999

deleteTempFolder

delete tempFolder containing the pickled np.arrays of the input data and output data tiles. should be called after all merged model results are written to disk. performs a few checks to make sure the folder is indeed a com4FlowPy tempFolder, i.e. - does not contain subfolders - no other file-extensions than '.npy' and ''.

mergeAndWriteResults

function handles merging of results for all tiles inside the temp Folder and also writing result files to the resultDir

performModelCalculation

wrapper around fc.run() handles passing of model paths, configurations to fc.run() also responsible for processing input-data tiles in sequence

startLogging

performs logging at the start of the simulation

tileInputLayers

computes the number of tiles (_tileCols, _tileRows) and tileOverlap (_U) based on input layer dimensions and tilingParameters, divides all used input layers into tiles and saves the tiles to the temp folder