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 mask in the model grid. data exposes only this layer. The grid reads and writes it through mskfile, together with elevation and the cell index.

See also

SfincsGrid

__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

data

Return only the available mask layer from the model grid.

data_catalog

Return the data catalog of the model this component is associated with.

empty_mask

Get an empty mask with the same shape as the model grid.

model

Return the model object this component is associated with.

name_in_model

Find the name of the component in the parent model components.

root

Return the root of the model this component is associated with.

transform

Get the affine transform of the model grid.