Nutrient Delivery Ratio Package¶
Model Entry Point¶
-
natcap.invest.ndr.ndr.
execute
(args)¶ Nutrient Delivery Ratio.
Parameters: - args['workspace_dir'] (string) – path to current workspace
- args['dem_uri'] (string) – path to digital elevation map raster
- args['lulc_uri'] (string) – a path to landcover map raster
- args['runoff_proxy_uri'] (string) – a path to a runoff proxy raster
- args['watersheds_uri'] (string) – path to the watershed shapefile
- args['biophysical_table_uri'] (string) –
path to csv table on disk containing nutrient retention values.
For each nutrient type [t] in args[‘calc_[t]’] that is true, must contain the following headers:
‘load_[t]’, ‘eff_[t]’, ‘crit_len_[t]’
If args[‘calc_n’] is True, must also contain the header ‘proportion_subsurface_n’ field.
- args['calc_p'] (boolean) – if True, phosphorous is modeled, additionally if True then biophysical table must have p fields in them
- args['calc_n'] (boolean) – if True nitrogen will be modeled, additionally biophysical table must have n fields in them.
- args['results_suffix'] (string) – (optional) a text field to append to all output files
- args['threshold_flow_accumulation'] – a number representing the flow accumulation in terms of upstream pixels.
- args['_prepare'] – (optional) The preprocessed set of data created by the ndr._prepare call. This argument could be used in cases where the call to this function is scripted and can save a significant amount DEM processing runtime.
Returns: None
Nutrient Delivery Ratio¶
Module for the execution of the biophysical component of the InVEST Nutrient Deposition model.
-
natcap.invest.ndr.ndr.
add_fields_to_shapefile
(key_field, field_summaries, output_layer, field_header_order=None)¶ Adds fields and their values indexed by key fields to an OGR layer open for writing.
- key_field - name of the key field in the output_layer that
- uniquely identifies each polygon.
- field_summaries - a dictionary indexed by the desired field
- name to place in the polygon that indexes to another dictionary indexed by key_field value to map to that particular polygon. ex {‘field_name_1’: {key_val1: value, key_val2: value}, ‘field_name_2’: {key_val1: value, etc.
output_layer - an open writable OGR layer field_header_order - a list of field headers in the order we
wish them to appear in the output table, if None then random key order in field summaries is used.returns nothing
-
natcap.invest.ndr.ndr.
execute
(args) Nutrient Delivery Ratio.
Parameters: - args['workspace_dir'] (string) – path to current workspace
- args['dem_uri'] (string) – path to digital elevation map raster
- args['lulc_uri'] (string) – a path to landcover map raster
- args['runoff_proxy_uri'] (string) – a path to a runoff proxy raster
- args['watersheds_uri'] (string) – path to the watershed shapefile
- args['biophysical_table_uri'] (string) –
path to csv table on disk containing nutrient retention values.
For each nutrient type [t] in args[‘calc_[t]’] that is true, must contain the following headers:
‘load_[t]’, ‘eff_[t]’, ‘crit_len_[t]’
If args[‘calc_n’] is True, must also contain the header ‘proportion_subsurface_n’ field.
- args['calc_p'] (boolean) – if True, phosphorous is modeled, additionally if True then biophysical table must have p fields in them
- args['calc_n'] (boolean) – if True nitrogen will be modeled, additionally biophysical table must have n fields in them.
- args['results_suffix'] (string) – (optional) a text field to append to all output files
- args['threshold_flow_accumulation'] – a number representing the flow accumulation in terms of upstream pixels.
- args['_prepare'] – (optional) The preprocessed set of data created by the ndr._prepare call. This argument could be used in cases where the call to this function is scripted and can save a significant amount DEM processing runtime.
Returns: None