natcap.invest.sdr.sdr_core

natcap.invest.sdr.sdr_core.calculate_average_aspect()

Calculate the Weighted Average Aspect Ratio from MFD.

Calculates the average aspect ratio weighted by proportional flow direction.

Parameters
  • mfd_flow_direction_path (string) – The path to an MFD flow direction raster.

  • target_average_aspect_path (string) – The path to where the calculated weighted average aspect raster should be written.

Returns

None.

natcap.invest.sdr.sdr_core.calculate_sediment_deposition()

Calculate sediment deposition layer.

This algorithm outputs both sediment deposition (r_i) and flux (f_i):

r_i  =      dr_i  * (sum over j ∈ J of f_j * p(i,j)) + E'_i

f_i  = (1 - dr_i) * (sum over j ∈ J of f_j * p(i,j)) + E'_i


        (sum over k ∈ K of SDR_k * p(i,k)) - SDR_i
dr_i = --------------------------------------------
                      (1 - SDR_i)

where:

  • p(i,j) is the proportion of flow from pixel i into pixel j

  • J is the set of pixels that are immediate upstream neighbors of pixel i

  • K is the set of pixels that are immediate downstream neighbors of pixel i

  • E' is USLE * (1 - SDR), the amount of sediment loss from pixel i that doesn’t reach a stream (e_prime_path)

  • SDR is the sediment delivery ratio (sdr_path)

f_i is recursively defined in terms of i’s upstream neighbors. The algorithm begins from seed pixels that are local high points and so have no upstream neighbors. It works downstream from each seed pixel, only adding a pixel to the stack when all its upstream neighbors are already calculated.

Note that this function is designed to be used in the context of the SDR model. Because the algorithm is recursive upstream and downstream of each pixel, nodata values in the SDR input would propagate along the flow path. This case is not handled because we assume the SDR and flow dir inputs will come from the SDR model and have nodata in the same places.

Parameters
  • mfd_flow_direction_path (string) – a path to a raster with pygeoprocessing.routing MFD flow direction values.

  • e_prime_path (string) – path to a raster that shows sources of sediment that wash off a pixel but do not reach the stream.

  • f_path (string) – path to a raster that shows the sediment flux on a pixel for sediment that does not reach the stream.

  • sdr_path (string) – path to Sediment Delivery Ratio raster.

  • target_sediment_deposition_path (string) – path to created that shows where the E’ sources end up across the landscape.

Returns

None.