hydromt_wflow.components.WflowStatesComponent#
- class hydromt_wflow.components.WflowStatesComponent(model: Model, *, filename: str = 'instate/instates.nc', region_component: str | None = None, region_filename: str | None = 'staticgeoms/states_region.geojson')[source]#
ModelComponent class for Wflow states.
This class is used for setting, creating, writing, and reading the Wflow states. The states component data stored in the
data
property of this class is of the hydromt.gis.raster.RasterDataset type which is an extension of xarray.Dataset for regular grid.Initialize the Wflow states component.
- Parameters:
model (Model) – HydroMT model instance.
filename (str, optional) – Default path relative to the root where the states file will be read and written. By default ‘instate/instates.nc’.
region_component (str, optional) – Name of the region component to align the states data with. If provided, the states data will be aligned with the grid of this component. By default None.
region_filename (str, optional) – A path relative to the root where the region file will be written. By default ‘staticgeoms/states_region.geojson’.
- __init__(model: Model, *, filename: str = 'instate/instates.nc', region_component: str | None = None, region_filename: str | None = 'staticgeoms/states_region.geojson')[source]#
Initialize the Wflow states component.
- Parameters:
model (Model) – HydroMT model instance.
filename (str, optional) – Default path relative to the root where the states file will be read and written. By default ‘instate/instates.nc’.
region_component (str, optional) – Name of the region component to align the states data with. If provided, the states data will be aligned with the grid of this component. By default None.
region_filename (str, optional) – A path relative to the root where the region file will be written. By default ‘staticgeoms/states_region.geojson’.
Methods
__init__
(model, *[, filename, ...])Initialize the Wflow states component.
get_mask_layer
(mask, *args)Get the proper mask layer based on itself or a layer in a Dataset.
read
([filename])Read the wflow states at root/filename.
set
(data[, name])Set the states data.
test_equal
(other)Test if two components are equal.
write
([filename])Write the wflow states to root/filename.
write_region
(*[, filename, to_wgs84])Write the model region to file.
Attributes
bounds
Returns the bounding box of the model grid.
crs
Returns coordinate reference system embedded in the model grid.
Model static gridded data as xarray.Dataset.
data_catalog
Return the data catalog of the model this component is associated with.
model
Return the model object this component is associated with.
region
Provide access to the underlying GeoDataFrame data of the model region.
res
Returns the resolution of the model grid.
root
Return the root of the model this component is associated with.
transform
Returns spatial transform of the model grid.