hydromt_wflow.components.WflowOutputScalarComponent#
Summary of Methods and Attributes#
Component class |
Methods |
Attributes |
|---|---|---|
|
- class WflowOutputScalarComponent(model: Model, *, filename: str = 'output_scalar.nc')[source]#
Bases:
ModelComponentModelComponent class for Wflow netcdf_scalar output.
This class is used for reading the Wflow netcdf_scalar output.
The overall output netcdf_scalar component data stored in the
dataproperty of this class is a xarray.Dataset.- read()[source]#
Read netcdf_scalar model output at root/dir_output/filename.
Checks the path of the file in the config toml using both
output.netcdf_scalar.pathanddir_output. If not found uses the default pathoutput_scalar.ncin the root folder.- Parameters:
**kwargs (dict) – Additional keyword arguments to be passed to the read_nc method.
- write()[source]#
Skip writing output files.
Output files are model results and are therefore not written by HydroMT.
- set(data: DataArray | Dataset, name: str | None = None)[source]#
Add data to netcdf_scalar output.
- Parameters:
data (xarray.DataArray or xarray.Dataset) – new map layer to add to netcdf_scalar output
name (str, optional) – Name of new map layer, this is used to overwrite the name of a DataArray and ignored if data is a Dataset
- test_equal(other: ModelComponent) tuple[bool, dict[str, str]][source]#
Test if two components are equal.
- property data_catalog: DataCatalog#
Return the data catalog of the model this component is associated with.
- finish_write()#
Finish the write functionality after cleanup was called for all components in the model.
All DeferredFileClose objects can overwrite any lazy loaded files now.
- property model: Model#
Return the model object this component is associated with.
- property root: ModelRoot#
Return the root of the model this component is associated with.