digger.make.slabs
¶
make.slabs is used to generate D-Claw input files with a constant depth over each landslide extent region. Files for b, h, eta, and m0 are generated. The amount of material may be specified either as a volume or a depth. Optionally, the edges of the constant-depth region may be smoothed. The location of material may be specified by either:
A polygon shapefile that has one or more polygons within it, or A polyline shapefile with one or more polylines in it. A buffer distance must be provided that specifies how the polylines are converted to polygons.
The shapefile may have one or more geometries (rows). For each feature in the shapefile, the following information is expected in the attribute table (attribute column names specified in the make.slabs documentation):
The volume or depth of initial, potentially mobile, material, The value for m0
within each polygon, and The buffer distance (for polyline shapfiles only).
The resulting output files support a number of additional options, including adding material of thickness h on top of the provided topography or subtracting it from the provided topography.
Module Contents¶
Functions¶
Calculate landslide failure slip surface using a constant depth and generate D-Claw compatible output. |
API¶
- digger.make.slabs.slabs(topo_path: str, shapefile_path: str, q1_prefix: str = 'q1', q4_prefix: str = 'q4', b_prefix: str = 'b', eta_prefix: str = 'eta', dx_coarse: float = 100.0, q4_buffer: float = 20.0, water_level: float = -9999.0, eta_dry: float | None = None, remove_h_from_topo: bool = False, blur_h: bool = False, blur_h_radius: float = 10.0, m0_default: float = 0.6, h_m_default: float = 0.5, clip_extent: bool = True, check_crs: bool = True, all_touched: bool = False, plot: bool = True, write_tt3: bool = False, write_tif: bool = False, fig_path: str = 'slab_source.png') float ¶
Calculate landslide failure slip surface using a constant depth and generate D-Claw compatible output.
Two options are supported, providing the input geometry as a Polygon type or LineString type shape. Either case supports multiple geometries (rows) per file.
If LineString type is provided, then there must be an attribute called “buff_m”, indicating the buffer distance in map units to convert the polyline to a polygon.
The volume or depth of material is specified as a column in the attribute table. One of the following must be provided:
“vol_m3” : the volume of material to be distributed (fluid and solid)
“h_m” : the depth of material
D-Claw uses MKS units. Digger will assume consistency between the units provided in the attribute table and the horizontal units of the coordinate reference system for topo_path and shapefile_path.
Finally, a unique solid volume fraction for each geometry may be provided, also in the attribute table of the shapefile with the column name “m0”. If this is not provided, then a default scalar value m0 is used. If m0 is provided in the shapefile, the default value is ignored.
- Inputs:
- topo_pathstr
Path to rasterio-readable file containing the topography input file. Output is written at the resolution of this file. Expected in projected coordinates (e.g., meters or feet, not degrees).
- shapefile_pathstr
Path to fiona-readable file with one or more geometries of the landslide source extent. Geometries must be Polygon or LineString type. Required.
- 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 eta (surface altitude). Outside of the slide area, eta is set to the value
eta_dry
to optionally ensure that D-Claw uses the value of b.- b_prefixstr
Prefix of the path to write any output of b (failure surface elevation, or eta-h)).
- q4_prefixstr
Prefix of the path to write any output of q4 (solid volume fraction, m).
- dx_coarsefloat
Buffer distance around the polygons generated from shapefile_path (+ buffer distance, if PolyLine type) used to generate the extent raster output. Provided in the map units of topo_path. Only used if clip_extent=True
- q4_bufferfloat
Buffer for q4 (prevents “edge water”).
- eta_dryfloat or None
If None, use eta = b where h = 0. Otherwise use eta_dry.
- water_levelfloat
Elevation of water level in the same units and vertical reference frame as topo_path. Not yet implemented.
- remove_h_from_topobool
If False (default), landslide material will be placed over the topography specified such that the provided topography file reflects b. If True, landslide material will be removed from the topography file such that the topography file reflects the final surface altitude eta. In either case, output for q1, q4, eta, and b are produced.
- blur_hbool
txt
- blur_h_radiusfloat
txt
- h_m_default :float
txt
- m0_defaultfloat
txt
- clip_extentbool
if False write all output as same shape as topo in.
- check_crsbool
Check compatibility between the coordinate reference system (CRS) of topo_path, source_path, and source_path_mask.
- all_touchedbool
Value used for rasterio.mask and rasterio.rasterize
- plotbool
Whether to make plots depicting some aspects of the output. Often useful for honing in on the specific values of alpha1, alpha2, and c used for an application.
- 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).
- write_tt3bool
Whether to write out topotype 3 files of q1, eta, q4, and b. If written, the *_prefix for each output has ‘.tt3’ added to the end.
- write_tifbool
Whether to write out geotif files of q1, eta, q4, and b. If written, the *_prefix for each output has ‘.tif’ added to the end.
- Outputs:
- volumefloat
Total failure volume in cubic units of topo_path.