digger.make.interpolation¶
Module Contents¶
Functions¶
Estimate landslide geometry by interpolating between the landslide extent and user-defined xyz points. |
API¶
- digger.make.interpolation.interpolation(topo_path: str, mask_path: str, points_path: str, edge_adjustment: float = 0, sense: str = 'subtract', smooth: bool = False, smooth_sigma: int = 5, b_prefix: str = 'b', q1_prefix: str = 'q1', eta_prefix: str = 'eta', write_tif: bool = True, write_tt3: bool = False, fig_path: str = 'interpolated.png')¶
Estimate landslide geometry by interpolating between the landslide extent and user-defined xyz points.
- Inputs:
- topo_pathstr
Path to rasterio-readable file containing the initial topography input file. Output is written at the resolution of this file. Expected in projected coordinates (e.g., meters or feet, not degrees).
- mask_pathstr
Path to fiona-readable file containing polygons indicating where the polyhedron should be applied.
- points_pathstr
Path to fiona-readable file containing Point geometries. This file must have two attribute columns:
depthandaltitude. If depth is provided, an (x,y,z) interpolation point is generated by subtracting the provided depth from the topography value at the (x,y) coordinate. If altitude is provided, then the (x,y,z) value uses the provided altitude for z.- edge_adjustmentfloat
Sometimes it is usefull to ensure that the landslide depth asymtotes to a value different from zero at the extent of the landslide. If this is the case, set edge_adjustment to a negative value and the z value for all edge points used in interpolatin will be adjusted by this amount.
- sensestr
Whether to add (
sense="add") or subtract (sense="subtract") the generated polyhedron from the topography. If sense is"add"then the file written tob_prefixwill be the provided topography and the polyhedron will be defined by volume contained underneath each plane and above the topography. In contrast, if sense is"subtract"the provided topography will be written out aseta_prefixand the polyhedron will be the volume above each plane and below the topography.- smoothbool
Flag to indicate whether to smooth after interpolating.
- smooth_sigmaint
Smoothing kernel passed to scipy.ndimage.gaussian_filter
- q1_prefixstr
Prefix of the path to write any output of q1 (thickness, h).
- eta_prefixstr
Prefix of the path to write any output of the surface altitude.
- b_prefixstr
Prefix of the path to write any output of b (eta-h).
- write_tt3bool
Whether to write out topotype 3 files b. If written, the
b_prefixhas ‘.tt3’ added to the end.- write_tifbool
Whether to write out geotif files of b. If written, the
b_prefixhas ‘.tif’ added to the end.- fig_pathstr
The base filepath for figures generated. The file extension will be used by matplotlib to determine the type of file (png, pdf, etc).
- Outputs:
- infodict
Dictionary of summary information. Includes the following key-value pairs:
Table 8 Output dictionary contents.¶ Key
Value
total_volume
The total failure volume in cubic units of
topo_path.maximum_thickness
The maximum thickness in units of
topo_path.mean_thickness
The mean thickness in units of
topo_path.