UMEP-dev / UMEP-processing

7 stars 9 forks source link

FileNotFoundError when using SOLWEIG #6

Closed jonas260492 closed 3 years ago

jonas260492 commented 3 years ago

First, thank you for your great tool! I am calculating maximum comfortable walking distances for pedestrians and SOLWEIG delivers me the Tmrt needed. I seperated my case city in ca. 9000 microclimatezones and wrote a script to automate the SOLWEIG tool with my inputs with UMEP Processing.

When I now run my script I get the following error, which I cannot explain:

Traceback (most recent call last): File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode exec(code, self.locals) File "", line 1, in File "", line 76, in File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\tools\general.py", line 108, in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\core\Processing.py", line 174, in runAlgorithm ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False) File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 71, in execute results, ok = alg.run(parameters, context, feedback, {}, False) _core.QgsProcessingException: Traceback (most recent call last): File "C:/Users/jonas/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processor\solweig_algorithm.py", line 831, in processAlgorithm data = np.load(folderPathPerez) File "C:\OSGEO4~1\apps\Python37\lib\site-packages\numpy\lib\npyio.py", line 417, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: ''

When using UMEP GUI it works perfectly. Thanks for your help in advance.

Best Jonas

biglimp commented 3 years ago

Please provide info on OS and versions of tools and software. The latest version of umep processing should be 1.3.

jonas260492 commented 3 years ago

Windows 10 Pro. I installed QGIS as described in the UMEP manual.

I just updated to version 1.3 and now it raises this error:

Traceback (most recent call last): File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode exec(code, self.locals) File "", line 1, in File "", line 76, in File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\tools\general.py", line 108, in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\core\Processing.py", line 174, in runAlgorithm ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False) File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 71, in execute results, ok = alg.run(parameters, context, feedback, {}, False) _core.QgsProcessingException: Traceback (most recent call last): File "C:/Users/jonas/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processor\solweig_algorithm.py", line 534, in processAlgorithm if (dsmraise != demraise) and (dsmraise - demraise > 0.5): UnboundLocalError: local variable 'demraise' referenced before assignment

Actually I just had a look at the solweig_algorithm and saw that in line 292 it is written dem=0, so actually the processing should not use dem to derive buildings but landcover? But why do I get the problem then?

Moreover I saw: folderPathPerez = self.parameterAsString(parameters, self.INPUT_ANISO, context) so if it is like this, do I need to use shadow maps as an input also? I didnt want to do it.

Thanks a lot. Jonas

biglimp commented 3 years ago

Thanks. Can you please attach the log output so That I can see your full settings when running the model.

jonas260492 commented 3 years ago

Where can I find this? There is no file created like for the succesful completition for SOLWEIG GUI.

This is part of my script: processing.run("umep:Outdoor Thermal Comfort: SOLWEIG",{'INPUT_DSM': inpath_DOM, 'INPUT_SVF': inpath_SVF, 'INPUT_HEIGHT': inpath_WHeight, 'INPUT_ASPECT': inpath_WAspect, 'INPUT_CDSM': inpath_nDOMv, 'TRANS_VEG': 3, 'INPUT_THEIGHT': 25,# check value 'INPUT_LC': inpath_LaCov, 'USE_LC_BUILD': True,

'INPUT_DEM': inpath_DEM,

           'SAVE_BUILD': False,
           #'INPUT_ANISO': ,
           'ALBEDO_WALLS': 0.2,
           #'ALBEDO_GROUND': 0.15, #hash
           'EMIS_WALLS': 0.9,
           #'EMIS_GROUND': 0.95, #hash
           'ABS_S': 0.7,
           'ABS_L': 0.97,
           'POSTURE': 0,
           'CYL': True,# check value
           'INPUTMET': inpath_meteo,
           'ONLYGLOBAL': True,
           'UTC': 1,
           #POI not included
           'SENSOR_HEIGHT': 2,
           'OUTPUT_TMRT': True,
           'OUTPUT_KDOWN': False,
           'OUTPUT_KUP': False,
           'OUTPUT_LDOWN': False,
           'OUTPUT_LUP': False,
           'OUTPUT_SH': False,
           'OUTPUT_TREEPLANTER': False,
           'OUTPUT_LUP': False,
           'OUTPUT_DIR': outpath})
biglimp commented 3 years ago

Aha, sorry, you run as standalone script. I suggest you just run the model in the toolbox to get the correct input parameters. Then just copy and paste for the log message window.

jonas260492 commented 3 years ago

Thank you so much. This was a good hint. Now everything is working smoothly!