hydromt_sfincs.components.quadtree.SfincsQuadtreeMask.create_active#
- SfincsQuadtreeMask.create_active(model: str = 'sfincs', zmin: float = None, zmax: float = None, include_polygon: str | Path | GeoDataFrame = None, include_zmin: float = None, include_zmax: float = None, exclude_polygon: str | Path | GeoDataFrame = None, exclude_zmin: float = None, exclude_zmax: float = None, all_touched: bool = False, reset_mask: bool = True, copy_sfincsmask: bool = False)[source]#
Setup active model cells.
The SFINCS model mask defines inactive (msk=0), active (msk=1), and waterlevel boundary (msk=2) and outflow boundary (msk=3) cells. This method sets the active and inactive cells.
Active model cells are based on a region and cells with valid elevation (i.e. not nodata), 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.
Adds mask layer to quadtree grid:
mask map: model mask [-]
- Parameters:
model (
str, optional) – Model type, either ‘sfincs’ (default) or ‘snapwave’, for which the mask will be created.zmin (
float, optional) – Minimum and maximum elevation thresholds for active model cells.zmax (
float, optional) – Minimum and maximum elevation thresholds for active model cells.include_polygon (
str,Path,gpd.GeoDataFrame, optional) – Path or data source name of polygons to include/exclude from the active model domain. Note that include (second last) and exclude (last) areas are processed after other critera, i.e. zmin, zmax and thus overrule these criteria for active model cells.exclude_polygon (
str,Path,gpd.GeoDataFrame, optional) – Path or data source name of polygons to include/exclude from the active model domain. Note that include (second last) and exclude (last) areas are processed after other critera, i.e. zmin, zmax and thus overrule these criteria for active model cells.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.reset_mask (
bool, optional) – If True, reset existing mask before creating new active model cells.copy_sfincsmask (
bool, optional) – If True and model is ‘snapwave’, copy the SFINCS mask to the SnapWave mask.