Skip to content

Instantly share code, notes, and snippets.

@richpsharp
Created April 6, 2020 06:03
Show Gist options
  • Save richpsharp/a0cd82d930c2fbdfa507dd8816223fa2 to your computer and use it in GitHub Desktop.
Save richpsharp/a0cd82d930c2fbdfa507dd8816223fa2 to your computer and use it in GitHub Desktop.
Example file of how to run SDR with the c-factor extension in a script
"""Example of how to use experimental SDR c-factor."""
import sys
import logging
import natcap.invest.sdr.sdr
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
args = {
'biophysical_table_path': './data/biophysical_SDR.csv',
'dem_path': './data/DEM/fillFinalSaga.tif',
'drainage_path': '',
'erodibility_path': './data/erodibility.tif',
'erosivity_path': './data/erosivity.tif',
'ic_0_param': '0.5',
'k_param': '2',
'lulc_path': './data/LULC.tif',
'results_suffix': '',
'sdr_max': '0.8',
'threshold_flow_accumulation': '200',
'watersheds_path': './data/Subsheds/Polysheds123.shp',
'workspace_di': 'sdr_workspace',
'c_factor_path': './data/data_bare_ground/data_bare_ground_2010_40N_80W_90W_resize_LULC_flt'
}
if __name__ == '__main__':
natcap.invest.sdr.sdr.execute(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment