digger.utils.interpolate¶
Module Contents¶
Functions¶
Remove cells in a raster dataset that are masked by a vector dataset and interpolate. |
API¶
- digger.utils.interpolate.polygon(topo_path: str, mask_path: str, smooth: bool = False, smooth_sigma: int = 5, file_out: str = 'interpolated.tif')¶
Remove cells in a raster dataset that are masked by a vector dataset and interpolate.
Linear interpolation is used to fill in values.
It is assumed that the raster and vector datasets are in the same coordinate system.
The resulting raster file has the same extent and resolution as the input raster.
- Inputs:
- topo_pathstr
Path of a rasterio-readable raster file
- mask_pathstr
Path to a fiona-readable Polygon-type vector file.
- smoothbool
Flag to indicate whether to smooth after interpolating.
- smooth_sigmaint
Smoothing kernel passed to scipy.ndimage.gaussian_filter
- file_outstr
Place to write the resulting interpolated file. Defaults to “interpolated.tif”.