# Sediment Delivery Ratio Package¶

## Model Entry Point¶

invest_natcap.sdr.sdr.execute(args)

This function invokes the SDR model given URI inputs of files. It may write log, warning, or error messages to stdout.

args - a python dictionary with at the following possible entries: args[‘workspace_dir’] - a uri to the directory that will write output

and other temporary files during calculation. (required)

args[‘results_suffix’] - a string to append to any output file name (optional) args[‘dem_uri’] - a uri to a digital elevation raster file (required) args[‘erosivity_uri’] - a uri to an input raster describing the

rainfall eroisivity index (required)
args[‘erodibility_uri’] - a uri to an input raster describing soil
erodibility (required)
args[‘lulc_uri’] - a uri to a land use/land cover raster whose
LULC indexes correspond to indexs in the biophysical table input. Used for determining soil retention and other biophysical properties of the landscape. (required)
args[‘watersheds_uri’] - a uri to an input shapefile of the watersheds
of interest as polygons. (required)
args[‘biophysical_table_uri’] - a uri to an input CSV file with
biophysical information about each of the land use classes.
args[‘threshold_flow_accumulation’] - an integer describing the number
of upstream cells that must flow int a cell before it’s considered part of a stream. required if ‘stream_uri’ is not provided.

args[‘k_param’] - k calibration parameter (see user’s guide for values) args[‘sdr_max’] - the max value the SDR can be args[‘ic_0_param’] - ic_0 calibration parameter (see user’s guide for

values)
args[‘drainage_uri’] - An optional GIS raster dataset mask, that
indicates areas that drain to the watershed. Format is that 1’s indicate drainage areas and 0’s or nodata indicate areas with no additional drainage. This model is most accurate when the drainage raster aligns with the DEM.
args[‘_prepare’] - (optional) The preprocessed set of data created by the
sdr._prepare call. This argument could be used in cases where the call to this function is scripted and can save a significant amount of runtime.

returns nothing.

## Sediment Delivery Ratio¶

InVEST Sediment Delivery Ratio (SDR) module

invest_natcap.sdr.sdr.calculate_ls_factor(flow_accumulation_uri, slope_uri, aspect_uri, ls_factor_uri, ls_nodata)

Calculates the LS factor as Equation 3 from “Extension and validation of a geographic information system-based method for calculating the Revised Universal Soil Loss Equation length-slope factor for erosion risk assessments in large watersheds”

(Required that all raster inputs are same dimensions and projections and have square cells) flow_accumulation_uri - a uri to a single band raster of type float that

indicates the contributing area at the inlet of a grid cell
slope_uri - a uri to a single band raster of type float that indicates
the slope at a pixel given as a percent
aspect_uri - a uri to a single band raster of type float that indicates the
direction that slopes are facing in terms of radians east and increase clockwise: pi/2 is north, pi is west, 3pi/2, south and 0 or 2pi is east.
ls_factor_uri - (input) a string to the path where the LS raster will
be written

returns nothing

invest_natcap.sdr.sdr.calculate_rkls(ls_factor_uri, erosivity_uri, erodibility_uri, stream_uri, rkls_uri)

Calculates per-pixel potential soil loss using the RKLS (revised universial soil loss equation with no C or P).

ls_factor_uri - GDAL uri with the LS factor pre-calculated erosivity_uri - GDAL uri with per pixel erosivity erodibility_uri - GDAL uri with per pixel erodibility stream_uri - GDAL uri indicating locations with streams

(0 is no stream, 1 stream)
rkls_uri - string input indicating the path to disk
for the resulting potential soil loss raster

returns nothing

invest_natcap.sdr.sdr.execute(args)

This function invokes the SDR model given URI inputs of files. It may write log, warning, or error messages to stdout.

args - a python dictionary with at the following possible entries: args[‘workspace_dir’] - a uri to the directory that will write output

and other temporary files during calculation. (required)

args[‘results_suffix’] - a string to append to any output file name (optional) args[‘dem_uri’] - a uri to a digital elevation raster file (required) args[‘erosivity_uri’] - a uri to an input raster describing the

rainfall eroisivity index (required)
args[‘erodibility_uri’] - a uri to an input raster describing soil
erodibility (required)
args[‘lulc_uri’] - a uri to a land use/land cover raster whose
LULC indexes correspond to indexs in the biophysical table input. Used for determining soil retention and other biophysical properties of the landscape. (required)
args[‘watersheds_uri’] - a uri to an input shapefile of the watersheds
of interest as polygons. (required)
args[‘biophysical_table_uri’] - a uri to an input CSV file with
biophysical information about each of the land use classes.
args[‘threshold_flow_accumulation’] - an integer describing the number
of upstream cells that must flow int a cell before it’s considered part of a stream. required if ‘stream_uri’ is not provided.

args[‘k_param’] - k calibration parameter (see user’s guide for values) args[‘sdr_max’] - the max value the SDR can be args[‘ic_0_param’] - ic_0 calibration parameter (see user’s guide for

values)
args[‘drainage_uri’] - An optional GIS raster dataset mask, that
indicates areas that drain to the watershed. Format is that 1’s indicate drainage areas and 0’s or nodata indicate areas with no additional drainage. This model is most accurate when the drainage raster aligns with the DEM.
args[‘_prepare’] - (optional) The preprocessed set of data created by the
sdr._prepare call. This argument could be used in cases where the call to this function is scripted and can save a significant amount of runtime.

returns nothing.