hydromt_sfincs.components.quadtree.SnapWaveQuadtreeMask.create_active#
- SnapWaveQuadtreeMask.create_active(model: str = 'snapwave', 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 Snapwave model mask defines inactive (msk=0), active (msk=1), and wave boundary (msk=2) 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 layer to quadtree grid:
snapwave_mask map: model mask [-]
- Parameters:
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, ccopy the SFINCS mask to the SnapWave mask.