imod.prepare.cleanup_riv#
- imod.prepare.cleanup_riv(idomain: DataArray | UgridDataArray, bottom: DataArray | UgridDataArray, stage: DataArray | UgridDataArray, conductance: DataArray | UgridDataArray, bottom_elevation: DataArray | UgridDataArray, concentration: DataArray | UgridDataArray | None = None) dict[str, DataArray | UgridDataArray][source]#
- Clean up river data, fixes some common mistakes causing ValidationErrors by doing the following: - Cells where conductance <= 0 are deactivated. 
- Cells where concentration < 0 are set to 0.0. 
- Cells outside active domain (idomain==1) are removed. 
- Align NoData: If one variable has an inactive cell in one cell, ensure this cell is deactivated for all variables. 
- River bottom elevations below model bottom of a layer are set to model bottom of that layer. 
- River bottom elevations which exceed river stage are lowered to river stage. 
 - Parameters:
- idomain (xarray.DataArray | xugrid.UgridDataArray) – MODFLOW 6 model domain. idomain==1 is considered active domain. 
- bottom (xarray.DataArray | xugrid.UgridDataArray) – Grid with model bottoms 
- stage (xarray.DataArray | xugrid.UgridDataArray) – Grid with river stages 
- conductance (xarray.DataArray | xugrid.UgridDataArray) – Grid with conductances 
- bottom_elevation (xarray.DataArray | xugrid.UgridDataArray) – Grid with river bottom elevations 
- concentration (xarray.DataArray | xugrid.UgridDataArray, optional) – Optional grid with concentrations 
 
- Returns:
- Dict of cleaned up grids. Has keys: “stage”, “conductance”, “bottom_elevation”, “concentration”. 
- Return type:
- dict[str, xarray.DataArray | xugrid.UgridDataArray]