imod.msw.SprinklingPoints#

class imod.msw.SprinklingPoints(art_grid: DataArray, x_p: ndarray | list[float], y_p: ndarray | list[float], layer_p: ndarray | list[int], id_sprinkling_p: ndarray | list[int], capacity_p: ndarray | list[float])[source]#

This contains the sprinkling capacities of links between SVAT units and groundwater/surface water locations. This class is capable of handling point data (IPF) for sprinkling wells, which is a mapping of grid cells to well locations. To specify the sprinkling capacity as grid, see imod.msw.Sprinkling.

This class is responsible for the file scap_svat.inp

Note

This class is still in an experimental state, and might change in future versions. It is not yet fully tested and validated.

Note

Right now, whether a point is located on an svat cell or not is evaluated on a per subunit basis, which can yield surprising results. This is not an issue for packages created with imod.msw.SprinklingPoints.from_imod5_data(). As they only do sprinkling for the rural areas (subunit=0) only, and sprinkling is turned off in urban areas.

Parameters:
  • art_grid (xr.DataArray) – Grid of the artificial recharge ids, with subunit coordinate. These will be used to map the artificial recharge abstraction well with the id provided in id_sprinkling_p.

  • x_p (np.ndarray | list[float]) – x-coordinates of the artificial recharge abstraction well. If the point is not located on an svat cell, the coupled cells in the art_grid will be treated as surface water.

  • y_p (np.ndarray | list[float]) – y-coordinates of the artificial recharge abstraction well. If the point is not located on an svat cell, the coupled cells in the art_grid will be treated as surface water.

  • layer_p (np.ndarray | list[int]) – layer indices of the artificial recharge abstraction well. If layer is 0, the point will be treated as the surface water abstraction.

  • id_sprinkling_p (np.ndarray | list[int]) – ids mapping of the artificial recharge abstraction well to the grid cells in art_grid.

  • capacity_p (np.ndarray | list[float]) – abstraction capacities of the artificial recharge abstraction well. Will be distributed over groundwater and surface water based on whether layer is 0 or not.

Examples

Map a single sprinkling point to a grid with two subunits. The well will sprinkle to all cells in the first subunit. We will use the arbitrary number 43 as sprinkling point id.

>>> import xarray as xr
>>> import imod
>>> grid = imod.util.empty_2d(dx=25.0, dy=25.0, xmin=0.0, xmax=50.0, ymin=0.0, ymax=50.0)
>>> art_grid = xr.concat(
...     [grid.fillna(43), grid.fillna(0)], dim="subunit"
... ).assign_coords(subunit=[0,1]).astype(int)
>>> sprinkling_points = imod.msw.SprinklingPoints(
...     art_grid=art_grid,
...     x_p=[12.5],
...     y_p=[12.5],
...     layer_p=[2],
...     id_sprinkling_p=[43],
...     capacity_p=[25.0],
... )
__init__(art_grid: DataArray, x_p: ndarray | list[float], y_p: ndarray | list[float], layer_p: ndarray | list[int], id_sprinkling_p: ndarray | list[int], capacity_p: ndarray | list[float]) → None[source]#

Methods

__init__(art_grid, x_p, y_p, layer_p, ...)

clip_box([time_min, time_max, x_min, x_max, ...])

Clip a package by a bounding box (time, y, x).

from_file(path, **kwargs)

Loads an imod msw package from a file (netcdf or zarr).

from_imod5_data(imod5_data)

Import sprinkling data from imod5 data artificial recharge grids.

get_regrid_methods()

Returns the default regrid methods for this package.

regrid_like(target_grid, regrid_cache[, ...])

Creates a package of the same type as this package, based on another discretization.

to_file(modeldirectory, pkgname[, ...])

Write package to file.

write(directory, index, svat, mf6_dis, mf6_well)

Write MetaSWAP package to its corresponding fixed format file.

Attributes

auxiliary_data_fields

dataset

pkg_id