digger.make.lake
¶
Module Contents¶
Functions¶
Modify topobathymetry to add a lake based on a contour set. |
API¶
- digger.make.lake.lake(topo_path: str, lake_contour_path: str, depth_field: str, depth_sense: int = -1.0, depth_unit_convert: float = 1.0, average_lake_surface_height: bool = True, lake_surface_height: float | None = None, b_prefix: str = 'b_lake', eta_prefix: str = 'eta_lake', west: float | None = None, south: float | None = None, east: float | None = None, north: float | None = None, write_tif: bool = True, write_tt3: bool = False, fig_path: str = 'lake.png')¶
Modify topobathymetry to add a lake based on a contour set.
This function modifies provide topobathymetry to add new areas of water by lowering the topographic elevation based on a contour set of polylines that represent lake depth.
This function requires a user to provide an initial topographic surface in
topo_path
and the contour set of lake depths inlake_contour_path
.lake_contour_path
must contain a contour with zero depth and within the extent of this contourmake.lake
will modify the topographic surface.The modified topography is written out to a file, diagnostic figures are written, and information about the lake extent is written out.
- Inputs:
- topo_pathstr
Path to rasterio-readable file containing the topography input file. Output is written at the resolution of this file.
- lake_contour_pathstr
Path to fiona-readable file containg lake contours. Must contain a zero contour.
- depth_fieldstr
Name of the attribute table column in
lake_contour_path
that contains lake depths.- depth_senseint
Depths are multiplied by
depth_sense
before being added to the topobathymetry. If depths below lake level are positive in the attribute table, setdepth_sense
to -1 to ensure that depths are subtracted from the topography.- depth_unit_convertfloat
Unit conversion factor for depths. Useful if depths are provided in feet or other units.
- average_lake_surface_heightbool
If
True
the average lake altitude within the extent of the lake is calculated and the topobathymetry is updated to use a constant lake altitude. This may be useful if the original topobathymetry is hydroconditioned and does not include a flat lake.- lake_surface_heightfloat
If provided and
average_lake_surface_height
is set toTrue
then this value is used instead of the calculated average lake altitude. This may be useful if there are some issues with the average value calculated by the hydroconditioning.- b_prefixstr
Prefix of the path to write any output of b (topobathymetric surface elevation, or eta-h)).
- eta_prefixstr
Prefix of the path to write any output of eta.
- westfloat
The extent within
topo_path
to consider for this analysis. Along withwest
,east
, andnorth
, this parameter may reduce the size of the terrain consider, speeding computation time and reducing file size.- southfloat
The extent within
topo_path
to consider for this analysis.- eastfloat
The extent within
topo_path
to consider for this analysis.- northfloat
The extent within
topo_path
to consider for this analysis.- write_tt3bool
Whether to write out topotype 3 files b. If written, the
b_prefix
has ‘.tt3’ added to the end.- write_tifbool
Whether to write out geotif files of b. If written, the
b_prefix
has ‘.tif’ added to the end.- fig_pathstr
The base filepath for figures generated.
- Outputs:
- infodict
Dictionary of summary information. Includes the following key-value pairs:
Table 8 Output dictionary contents.¶ Key
Value
x1
Minimum x-value of the lake extent bounds.
x2
Maximum x-value of the lake extent bounds.
y1
Minimum x-value of the lake extent bounds.
y2
Maximum y-value of the lake extent bounds.
lake_surface_height
Either provided lake surface height or the average lake surface from initial topobathymetry.