Skip to content

Commit

Permalink
Adding a docstring for the new function.
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Dec 20, 2022
1 parent 9d3a3f1 commit fec0ddc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/pygeoprocessing/routing/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@
def extract_streams_d8(
flow_accum_raster_path_band, flow_threshold, target_stream_raster_path,
raster_driver_creation_tuple=DEFAULT_GTIFF_CREATION_TUPLE_OPTIONS):
"""Extract D8 streams based on a flow accumulation threshold.
Creates an unsigned byte raster where pixel values of 1 indicate the
presence of a stream and pixel values of 0 indicate the absence of a
stream. Any flow accumulation pixels greater than ``flow_threshold`` are
considered stream pixels. Nodata values found in the input flow
accumulation raster propagate through to the target stream raster.
Args:
flow_accum_raster_path_band (tuple): A (path, band) tuple indicating
the path to a D8 flow accumulation raster and the band index to
use.
flow_threshold (number): The flow threshold. Flow accumulation values
greater than this threshold are considered stream pixels, values
less than this threshold are non-stream pixels.
target_stream_raster_path (string): Where the target streams raster
should be written.
raster_driver_creation_tuple (tuple): A tuple where the first element
is the GDAL driver name of the target raster and the second element
is an iterable of raster creation options for the selected driver.
Returns:
``None``
"""
flow_accum_nodata = get_raster_info(
flow_accum_raster_path_band[0])['nodata'][
flow_accum_raster_path_band[1]-1]
Expand Down

0 comments on commit fec0ddc

Please sign in to comment.