hydromt_sfincs.SfincsModel.setup_mask_bounds#
- SfincsModel.setup_mask_bounds(btype: str = 'waterlevel', include_mask: str | Path | GeoDataFrame | None = None, exclude_mask: str | Path | GeoDataFrame | None = None, zmin: float | None = None, zmax: float | None = None, connectivity: int = 8, all_touched: bool = False, reset_bounds: bool = False)[source]#
Set boundary cells in the model mask.
The SFINCS model mask defines inactive (msk=0), active (msk=1), and waterlevel boundary (msk=2) and outflow boundary (msk=3) cells. Active cells set using the setup_mask method, while this method sets both types of boundary cells, see btype argument.
Boundary cells at the edge of the active model domain, optionally bounded by areas inside the include geomtries, outside the exclude geomtries, larger or equal than a minimum elevation threshhold and smaller or equal than a maximum elevation threshhold. All conditions are combined using a logical AND operation.
Updates model layers:
msk map: model mask [-]
- Parameters:
btype ({'waterlevel', 'outflow'}) – Boundary type
include_mask (str, Path, gpd.GeoDataFrame, optional) – Path or data source name for geometries with areas to include/exclude from the model boundary.
exclude_mask (str, Path, gpd.GeoDataFrame, optional) – Path or data source name for geometries with areas to include/exclude from the model boundary.
zmin (float, optional) – Minimum and maximum elevation thresholds for boundary cells. Note that when include and exclude areas are used, the elevation range is only applied on cells within the include area and outside the exclude area.
zmax (float, optional) – Minimum and maximum elevation thresholds for boundary cells. Note that when include and exclude areas are used, the elevation range is only applied on cells within the include area and outside the exclude area.
reset_bounds (bool, optional) – If True, reset existing boundary cells of the selected boundary type (btype) before setting new boundary cells, by default False.
all_touched (bool, optional) – if True (default) include (or exclude) a cell in the mask if it touches any of the include (or exclude) geometries. If False, include a cell only if its center is within one of the shapes, or if it is selected by Bresenham’s line algorithm.
connectivity – The connectivity used to detect the model edge, if 4 only horizontal and vertical connections are used, if 8 (default) also diagonal connections.
{4 – The connectivity used to detect the model edge, if 4 only horizontal and vertical connections are used, if 8 (default) also diagonal connections.
8} – The connectivity used to detect the model edge, if 4 only horizontal and vertical connections are used, if 8 (default) also diagonal connections.