UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
62 stars 15 forks source link

Missed step in Urban Energy Balance - SUEWS Spatial tutorial #656

Open guscarthd opened 1 week ago

guscarthd commented 1 week ago

When using zonal statistics to calculated the mean daytime population (the Population density part) a new layer is created with all the attributes from the Grid_500m layer and a new column for PPdaymean. When calculating the mean nightime population "append to layer" have to be selected using the new layer created above. This creates a temporary layer with the attributes from Grid_500m + PPdaymean and PPnightmean. This is the final layer (exported) which have to be used in SUEWS prepared to access all attribute fields that are needed.

guscarthd commented 1 week ago

Second related issue: Further down in the tutorial part "Running the SUEWS model in UMEP" during the step "Open UMEP > Processor > Urban Energy Balance > SUEWS/BLUEWS, Advanced." a pop up message appears that "this tool has moved to UMEP for processing". In UMEP for processing the tool is called "Urban Energy Balance: SUEWS v2020" and lack the tick box Obtain temporal resolution and Apply spin-up using….

guscarthd commented 1 week ago

Running SUEWS (QGIS 3.38) results in the following error: File "C:\Users/tessa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processor\suews_algorithm.py", line 248, in processAlgorithm df_output, df_state_final = sp.run_supy(df_forcing, ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tessa\AppData\Roaming\Python\Python312\site-packages\supy_supy_module.py", line 371, in run_supy df_output, df_state_final = run_supy_ser( ^^^^^^^^^^^^^ File "C:\Users\tessa\AppData\Roaming\Python\Python312\site-packages\supy_run.py", line 415, in run_supy_ser df_output = df_output.drop("ESTM", axis=1, level="group") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\frame.py", line 5581, in drop return super().drop( ^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\generic.py", line 4788, in drop obj = obj._drop_axis(labels, axis, level=level, errors=errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\generic.py", line 4869, in _drop_axis new_mgr = self._mgr.reindex_indexer( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\internals\managers.py", line 680, in reindex_indexer new_blocks = self._slice_take_blocks_ax0( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\internals\managers.py", line 843, in _slice_take_blocks_ax0 nb = blk.take_nd(taker, axis=0, new_mgr_locs=mgr_locs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\internals\blocks.py", line 1307, in take_nd new_values = algos.take_nd( ^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\array_algos\take.py", line 117, in take_nd return _take_nd_ndarray(arr, indexer, axis, fill_value, allow_fill) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\array_algos\take.py", line 157, in _take_nd_ndarray out = np.empty(out_shape, dtype=dtype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ numpy.core._exceptions._ArrayMemoryError: Unable to allocate 11.7 GiB for an array with shape (936, 1681920) and data type float64

Execution failed after 850.81 seconds (14 minutes 11 seconds)

biglimp commented 13 hours ago

Second related issue: Further down in the tutorial part "Running the SUEWS model in UMEP" during the step "Open UMEP > Processor > Urban Energy Balance > SUEWS/BLUEWS, Advanced." a pop up message appears that "this tool has moved to UMEP for processing". In UMEP for processing the tool is called "Urban Energy Balance: SUEWS v2020" and lack the tick box Obtain temporal resolution and Apply spin-up using….

This is now fixed.

biglimp commented 13 hours ago

Running SUEWS (QGIS 3.38) results in the following error: File "C:\Users/tessa/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processor\suews_algorithm.py", line 248, in processAlgorithm df_output, df_state_final = sp.run_supy(df_forcing, ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tessa\AppData\Roaming\Python\Python312\site-packages\supy_supy_module.py", line 371, in run_supy df_output, df_state_final = run_supy_ser( ^^^^^^^^^^^^^ File "C:\Users\tessa\AppData\Roaming\Python\Python312\site-packages\supy_run.py", line 415, in run_supy_ser df_output = df_output.drop("ESTM", axis=1, level="group") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\frame.py", line 5581, in drop return super().drop( ^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\generic.py", line 4788, in drop obj = obj._drop_axis(labels, axis, level=level, errors=errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\generic.py", line 4869, in _drop_axis new_mgr = self._mgr.reindex_indexer( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\internals\managers.py", line 680, in reindex_indexer new_blocks = self._slice_take_blocks_ax0( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\internals\managers.py", line 843, in _slice_take_blocks_ax0 nb = blk.take_nd(taker, axis=0, new_mgr_locs=mgr_locs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\internals\blocks.py", line 1307, in take_nd new_values = algos.take_nd( ^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\array_algos\take.py", line 117, in take_nd return _take_nd_ndarray(arr, indexer, axis, fill_value, allow_fill) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.3\apps\Python312\Lib\site-packages\pandas\core\array_algos\take.py", line 157, in _take_nd_ndarray out = np.empty(out_shape, dtype=dtype) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ numpy.core._exceptions._ArrayMemoryError: Unable to allocate 11.7 GiB for an array with shape (936, 1681920) and data type float64

Execution failed after 850.81 seconds (14 minutes 11 seconds)

This memory issue could be avoided by not having multiple QGIS running and also closing down unnecessary processes/software on your computer. Also, update your QGIS to latest version.