Skip to content
Snippets Groups Projects
Commit 318c7152 authored by Anthony's avatar Anthony
Browse files

Small change to avoir error when sorted_outareas is smaller than largest_pos...

Small change to avoir error when sorted_outareas is smaller than largest_pos (it occurs in Pantanal_n48)
parent d64427ec
No related branches found
No related tags found
Loading
......@@ -355,15 +355,16 @@ class HydroSuper :
if part.size == 1 :
maxdiff_sorted = 0.0
else :
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted))
old_sorted[:] = sorted_outareas[0:largest_pos]
l = min(sorted_outareas.shape[0],largest_pos)
maxdiff_sorted = np.max(np.abs(sorted_outareas[0:largest_pos]-old_sorted[0:l]))
old_sorted[:l] = sorted_outareas[0:largest_pos]
iter_count += 1
self.fetch_basin = np.copy(fetch_basin)
#
# Upstream area of the smalest river we call largest rivers.
#
self.largest_rivarea = sorted_outareas[largest_pos-1]
self.largest_rivarea = sorted_outareas[l-1]
#
#
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment