Skip to content

Commit

Permalink
bugfix in finding largest catchment
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskaus committed Jul 5, 2024
1 parent f105507 commit 6e1b1bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/WaterFlow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ function waterflows(Topo::GeoData, flowdir_fn= WhereTheWaterFlows.d8dir_feature;
feedback_fn=feedback_fn, drain_pits=drain_pits, bnd_as_sink=bnd_as_sink)

catchment_large = prune_catchments(c, minsize; val=0)
largest_catchment = catchment_large .== maximum(catchment_large)

_, id_max = findmax(area)
largest_catchment = catchment_large .== catchment_large[id_max]
largest_area = copy(area)
largest_area[.!largest_catchment] .= NaN

Expand Down

0 comments on commit 6e1b1bb

Please sign in to comment.