hydromt_sfincs.components.grid.SfincsMask#
- class hydromt_sfincs.components.grid.SfincsMask(model: SfincsModel)[source]#
SFINCS Mask Component.
This component contains methods to create a mask for the SFINCS model on regular grid. The mask defines active and inactive cells in the model grid, as well as boundary cells for water level and outflow boundaries.
Note
Mask data is stored as
maskin the model grid.dataexposes only this layer. The grid reads and writes it throughmskfile, together with elevation and the cell index.See also
- __init__(model: SfincsModel)[source]#
Methods
__init__(model)close()Clean up all open datasets.
create([zmin, zmax, include_polygon, ...])Setup active model mask and add boundaries.
create_active([zmin, zmax, include_polygon, ...])Create an integer mask with inactive (mask=0) and active (mask=1) cells, optionally bounded by several criteria.
create_boundary([btype, zmin, zmax, ...])Set boundary cells in the model mask.
finish_write()Finish the write functionality after cleanup was called for all components in the model.
has_open_boundaries()Returns True if mask contains open boundaries (mask = 2)
read()Ensure the grid is loaded; it reads the mask from
mskfile.test_equal(other)Test if two components are equal.
to_gdf([option])Convert a boolean mask to a GeoDataFrame of polygons.
write()Leave mask persistence to
model.grid.write().Attributes
Return only the available mask layer from the model grid.
data_catalogReturn the data catalog of the model this component is associated with.
empty_maskGet an empty mask with the same shape as the model grid.
modelReturn the model object this component is associated with.
name_in_modelFind the name of the component in the parent model components.
rootReturn the root of the model this component is associated with.
transformGet the affine transform of the model grid.