You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The soil class could be -999 for in some HRUs, which will cause an error FATAL ERROR: summa_paramSetup/pOverwrite/index for soil type must be > 0 when running SUMMA. The corresponding vegTypeIndex is 17, indicating water bodies. Two example basins with this problem are CAMELS 05062500 and 05129115, based on limited testing.
(2) The fill value of -999 could cause an error in summa. In my cases, those HRUs are water bodies, while it is still possible in some regions, we have unpredicted data bias. A possible and safe way is to assign the most frequent soil class and vegetation class over the basin to the problematic HRU, and then print the warning of the value replacement. It could be more ideal to search nearby HRUs but I am not sure if the increased time cost and complexity are preferred. The below are example soil codes, which can be inserted after Line 84 and 120 in 2a_insert_soilclass_from_hist_into_attributes.py, respectively.
# find the most frequent class
basin_hist = [-1]
for j in range(1, 13):
if 'USGS_' + str(j) in shp.columns:
basin_hist.append(shp['USGS_' + str(j)].sum())
else:
basin_hist.append(0)
basinmax_sc = np.argmax(np.asarray(basin_hist))
if tmp_sc == -999:
tmp_sc = basinmax_sc
The text was updated successfully, but these errors were encountered:
The soil class could be -999 for in some HRUs, which will cause an error
FATAL ERROR: summa_paramSetup/pOverwrite/index for soil type must be > 0
when running SUMMA. The corresponding vegTypeIndex is 17, indicating water bodies. Two example basins with this problem are CAMELS 05062500 and 05129115, based on limited testing.There are two problems needing to be solved:
(1) The judgement of
tmp_hist
will break if all its values are zero, because the largest value is always the first value according to numpy. A possible way is to useif np.all(np.array(tmp_hist[1:]) == 0) or shp['USGS_' + str(tmp_sc)][shp_mask].values != tmp_hist[tmp_sc]:
to replaceif shp['USGS_' + str(tmp_sc)][shp_mask].values != tmp_hist[tmp_sc]:
The two lines need modification:
https://github.com/CH-Earth/summaWorkflow_public/blob/master/5_model_input/SUMMA/1f_attributes/2b_insert_landclass_from_hist_into_attributes.py#L116
https://github.com/CH-Earth/summaWorkflow_public/blob/master/5_model_input/SUMMA/1f_attributes/2a_insert_soilclass_from_hist_into_attributes.py#L117
(2) The fill value of -999 could cause an error in summa. In my cases, those HRUs are water bodies, while it is still possible in some regions, we have unpredicted data bias. A possible and safe way is to assign the most frequent soil class and vegetation class over the basin to the problematic HRU, and then print the warning of the value replacement. It could be more ideal to search nearby HRUs but I am not sure if the increased time cost and complexity are preferred. The below are example soil codes, which can be inserted after Line 84 and 120 in
2a_insert_soilclass_from_hist_into_attributes.py
, respectively.The text was updated successfully, but these errors were encountered: