imod.select.points_set_values#
- imod.select.points_set_values(da: DataArray | UgridDataArray, values: int | float | ndarray[Any, dtype[number]], out_of_bounds: str = 'raise', **points)[source]#
Set values at specified points.
This function will raise a ValueError if the points fall outside of the bounds of the DataArray to avoid ambiguous behavior. Use the
imod.select.points_in_bounds
function to detect these points.- Parameters:
da (xr.DataArray)
values ((int, float) or array of (int, float))
out_of_bounds ({"raise", "warn", "ignore"}, default: "raise") – What to do if the points are not located in the bounds of the DataArray: - “raise”: raise an exception - “warn”: raise a warning, and ignore the missing points - “ignore”: ignore the missing points
points (keyword arguments of coordinate=values) – keyword arguments specifying coordinate and values.
- Returns:
da – DataArray with values set at the point locations.
- Return type:
xr.DataArray
Examples
>>> x = [1.0, 2.2, 3.0] >>> y = [4.0, 5.6, 7.0] >>> values = [10.0, 11.0, 12.0] >>> out = imod.select.points_set_values(da, values, x=x, y=y)