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
dataproperty 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.
clip()Clip the forcing component to the region of the region component.
close()Clean up all open datasets.
finish_write()Finish the write functionality after cleanup was called for all components in the model.
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
boundsReturns the bounding box of the model grid.
crsReturns coordinate reference system embedded in the model grid.
Model static gridded data as xarray.Dataset.
data_catalogReturn the data catalog of the model this component is associated with.
modelReturn the model object this component is associated with.
name_in_modelFind the name of the component in the parent model components.
regionProvide access to the underlying GeoDataFrame data of the model region.
resReturns the resolution of the model grid.
rootReturn the root of the model this component is associated with.
transformReturns spatial transform of the model grid.