imod.prepare.cleanup_drn#

imod.prepare.cleanup_drn(idomain: DataArray | UgridDataArray, elevation: DataArray | UgridDataArray, conductance: DataArray | UgridDataArray, concentration: DataArray | UgridDataArray | None = None) dict[str, DataArray | UgridDataArray][source]#

Clean up drain 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.

Parameters:
  • idomain (xarray.DataArray | xugrid.UgridDataArray) – MODFLOW 6 model domain. idomain==1 is considered active domain.

  • elevation (xarray.DataArray | xugrid.UgridDataArray) – Grid with drain elevations

  • conductance (xarray.DataArray | xugrid.UgridDataArray) – Grid with conductances

  • concentration (xarray.DataArray | xugrid.UgridDataArray, optional) – Optional grid with concentrations

Returns:

Dict of cleaned up grids. Has keys: “elevation”, “conductance”, “concentration”.

Return type:

dict[str, xarray.DataArray | xugrid.UgridDataArray]