Skip to content

Commit

Permalink
Commenting the -1. RE:natcap#915
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Aug 21, 2023
1 parent 74877a4 commit 4b5e13e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/natcap/invest/sdr/sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,9 @@ def ls_factor_function(percent_slope, flow_accumulation, l_max):
# root of the upstream contributing area here as an estimate, which
# matches the SAGA LS Factor option "square root of catchment area".
# See the InVEST ADR-0001 for more information.
# We subtract 1 from the flow accumulation because FA includes itself
# in its count of pixels upstream and our LS factor equation wants only
# those pixels that are strictly upstream.
contributing_area = numpy.sqrt(
(flow_accumulation[valid_mask]-1) * cell_area)
slope_in_radians = numpy.arctan(percent_slope[valid_mask] / 100.0)
Expand Down

0 comments on commit 4b5e13e

Please sign in to comment.