in1Data.getInput.getAndCheckInputFiles
- getAndCheckInputFiles(inputDir, folder, inputType, fileExt='shp', fileSuffix='')[source]
Fetch fileExt files and check if they exist and if it is not more than one. If fileExt is set to “raster” both .asc and .tif files will be searched.
Raises error if there is more than one fileExt file.
If fileExt is empty, only suffix will be checked.
If a file is found, it is checked to be of an allowed extension; currently .shp .asc and .tif are supported.
- Parameters
inputDir (pathlib object or str) – path to avalanche input directory
folder (str) – subfolder name where the shape file should be located (SECREL, ENT or RES)
inputType (str) – type of input (used for the logging messages).
fileExt (str, list) – file extension e.g. shp, asc, tif - optional; default is shp
fileSuffix (str) – file name part before extension
- Returns
OutputFile (str) – path to file checked
available (str) – Yes or No depending on if there is a file available (if No, OutputFile is None)