hydromt_delwaq.workflows.segments.pointer#
- hydromt_delwaq.workflows.segments.pointer(ds_hydro: ~xarray.core.dataset.Dataset, build_pointer: bool = False, surface_water: str = 'sfw', boundaries: ~typing.List[str] = ['bd'], fluxes: ~typing.List[str] = ['sfw>sfw', 'bd>sfw'], logger=<Logger hydromt_delwaq.workflows.segments (WARNING)>)[source]#
Return map with Delwaq segment ID and pointer.
The pointer matrix is built only if
build_pointer
is True.- Parameters:
ds_hydro (xr.Dataset) – Dataset of the hydromaps, contains ‘basins’, ‘ldd’, ‘modelmap’.
build_pointer (boolean, optional) – Boolean to build a pointer file (delwaq) or not (demission). If True, compartments, boundaries and fluxes lists must be provided.
surface_water (str, optional) – Name of the surface water layer. By default ‘sfw’.
boundaries (list of str, optional) – List of names of boundaries to include. By default a unique boundary called ‘bd’.
fluxes (list of str) – List of fluxes to include between surface water/boundaries. Name convention is ‘{surface_water_name}>{boundary_name}’ for a flux from the surface water to a boundary, ex ‘sfw>bd’. By default [‘sfw>sfw’, ‘bd>sfw’] for runoff and inwater. Names in the fluxes list should match name in the hydrology_fn source in setup_hydrology_forcing.
- Returns:
nrofseg (int) – Number of segments.
da_ptid (xarray.DataArray) – DataArray containing the Delwaq segment IDs.
da_ptiddown (xarray.DataArray) – DataArray containing the Delwaq downstream segment IDs.
pointer (numpy.ndarray, optional) – Delwaq pointer array (4 columns) for exchanges.
bd_id (numpy.array, optional) – Array with Delwaq boundary IDs.
bd_type (numpy.array, optional) – Array ith Delwaq boundary names.