imod.mf6.River.from_imod5_data#

classmethod River.from_imod5_data(key: str, imod5_data: dict[str, dict[str, ~xarray.core.dataarray.DataArray | ~xugrid.core.wrap.UgridDataArray]], period_data: dict[str, list[~datetime.datetime]], target_dis: ~imod.mf6.dis.StructuredDiscretization, target_npf: ~imod.mf6.npf.NodePropertyFlow, time_min: ~datetime.datetime, time_max: ~datetime.datetime, allocation_option: ~imod.prepare.topsystem.allocation.ALLOCATION_OPTION, distributing_option: ~imod.prepare.topsystem.conductance.DISTRIBUTING_OPTION, regridder_types: ~imod.mf6.regrid.regrid_schemes.RiverRegridMethod | None = None, regrid_cache: ~imod.util.regrid.RegridderWeightsCache = <imod.util.regrid.RegridderWeightsCache object>) Tuple[River | None, Drainage | None][source]#

Construct a river-package from iMOD5 data, loaded with the imod.formats.prj.open_projectfile_data() function.

Note

The method expects the iMOD5 model to be fully 3D, not quasi-3D.

Parameters:
  • key (str) – Packagename of the package that needs to be converted to river package.

  • imod5_data (dict) – Dictionary with iMOD5 data. This can be constructed from the imod.formats.prj.open_projectfile_data() method.

  • period_data (dict) – Dictionary with iMOD5 period data. This can be constructed from the imod.formats.prj.open_projectfile_data() method.

  • target_dis (StructuredDiscretization package) – The grid that should be used for the new package. Does not need to be identical to one of the input grids.

  • time_min (datetime) – Begin-time of the simulation. Used for expanding period data.

  • time_max (datetime) – End-time of the simulation. Used for expanding period data.

  • allocation_option (ALLOCATION_OPTION) – allocation option. If package data is assigned to a negative layer number, this option is overridden and set to ALLOCATION_OPTION.at_first_active.

  • distributing_option (DISTRIBUTING_OPTION) – distributing option.

  • regridder_types (RiverRegridMethod, optional) – Optional dataclass with regridder types for a specific variable. Use this to override default regridding methods.

  • regrid_cache (RegridderWeightsCache, optional) – stores regridder weights for different regridders. Can be used to speed up regridding, if the same regridders are used several times for regridding different arrays.

Returns:

  • A tuple containing a River package and a Drainage package. The Drainage

  • package accounts for the infiltration factor which exists in iMOD5 but

  • not in MF6. It furthermore potentially contains drainage cells above

  • river stage if ALLOCATION_OPTION.stage_to_riv_bot_drn_above is

  • chosen. Both the river package and the drainage package can be None,

  • this can happen if the infiltration factor is 0 or 1 everywhere.