hydromt.MeshModel.set_mesh#
- MeshModel.set_mesh(data: UgridDataArray | UgridDataset, name: str | None = None, grid_name: str | None = None, overwrite_grid: bool | None = False) None #
Add data to mesh.
All layers of mesh have identical spatial coordinates in Ugrid conventions. Also updates self.region if grid_name is new or overwrite_grid is True.
- Parameters:
data (
xugrid.UgridDataArray
orxugrid.UgridDataset
) – new layer to add to mesh, should contain only one grid topology.name (
str
, optional) – Name of new object layer, this is used to overwrite the name of a UgridDataArray.grid_name (
str
, optional) – Name of the mesh grid to add data to. If None, inferred from data. Can be used for renaming the grid.overwrite_grid (
bool
, optional) – If True, overwrite the grid with the same name as the grid in self.mesh.