hydromt_wflow.components.WflowForcingComponent#
- class hydromt_wflow.components.WflowForcingComponent(model: Model, *, filename: str = 'inmaps.nc', region_component: str | None = None, region_filename: str = 'staticgeoms/forcing_region.geojson')[source]#
Wflow forcing component.
This class is used for setting, creating, writing, and reading the Wflow forcing. The forcing 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 a WflowForcingComponent.
- Parameters:
model (Model) – HydroMT model instance
filename (str, optional) – Default path relative to the root where the forcing file(s) will be read and written. By default ‘inmaps.nc’.
region_component (str, optional) – The name of the region component to use as reference for this component’s region. If None, the region will be set to the grid extent.
region_filename (str, optional) – A path relative to the root where the region file will be written. By default ‘staticgeoms/forcing_region.geojson’.
- __init__(model: Model, *, filename: str = 'inmaps.nc', region_component: str | None = None, region_filename: str = 'staticgeoms/forcing_region.geojson')[source]#
Initialize a WflowForcingComponent.
- Parameters:
model (Model) – HydroMT model instance
filename (str, optional) – Default path relative to the root where the forcing file(s) will be read and written. By default ‘inmaps.nc’.
region_component (str, optional) – The name of the region component to use as reference for this component’s region. If None, the region will be set to the grid extent.
region_filename (str, optional) – A path relative to the root where the region file will be written. By default ‘staticgeoms/forcing_region.geojson’.
Methods
__init__
(model, *[, filename, ...])Initialize a WflowForcingComponent.
get_mask_layer
(mask, *args)Get the proper mask layer based on itself or a layer in a Dataset.
read
(**kwargs)Read forcing model data at root/dir_input/filename.
set
(data[, name])Add data to forcing.
test_equal
(other)Test if two components are equal.
write
(*[, filename, output_frequency, ...])Write forcing model data.
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.