Skip to content

Commit

Permalink
Merge pull request #178 from emlys/task/convolve_2d-docstring
Browse files Browse the repository at this point in the history
add to convolve_2d docstring
  • Loading branch information
richpsharp authored May 12, 2021
2 parents 7ed1c0c + 03c51be commit afb9c43
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/pygeoprocessing/geoprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ def zonal_statistics(
aggregation coverage close to optimally by rasterizing sets of
polygons that don't overlap. However, this step can be
computationally expensive for cases where there are many polygons.
Setting this flag to False directs the function rasterize in one
this flag to False directs the function rasterize in one
step.
working_dir (string): If not None, indicates where temporary files
should be created during this run.
Expand Down Expand Up @@ -2477,6 +2477,18 @@ def convolve_2d(
Nodata values are treated as 0.0 during the convolution and masked to
nodata for the output result where ``signal_path`` has nodata.
Note with default values, boundary effects can be seen in the result where
the kernel would hang off the edge of the raster or in regions with
nodata pixels. The function would treat these areas as values with "0.0"
by default thus pulling the total convolution down in these areas. This
is similar to setting ``mode='same'`` in Numpy's ``convolve`` function:
https://numpy.org/doc/stable/reference/generated/numpy.convolve.html
This boundary effect can be avoided by setting
``ignore_nodata_and_edges=True`` which normalizes the target result by
dynamically accounting for the number of valid signal pixels the kernel
overlapped during the convolution step.
Args:
signal_path_band (tuple): a 2 tuple of the form
(filepath to signal raster, band index).
Expand Down

0 comments on commit afb9c43

Please sign in to comment.