hydromt.model.components.GridComponent.add_data_from_constant#
- GridComponent.add_data_from_constant(constant: int | float, name: str, dtype: str | None = 'float32', nodata: int | float | None = None, mask_name: str | None = 'mask') List[str] [source]#
HYDROMT CORE METHOD: Adds data to grid component based on a constant value.
- Parameters:
name (
str
) – Name of grid.dtype (
str
, optional) – Data type of grid. By default ‘float32’.nodata (
int
,float
, optional) – Nodata value. By default inferred from dtype.mask_name (
str
, optional) – Name of mask in self.grid to use for masking raster_data. By default ‘mask’. Use None to disable masking.
- Returns:
Names of added model grid layer.
- Return type: