topotoolbox.run_graphflood#
- topotoolbox.run_graphflood(grid: GridObject, initial_hw: ndarray | GridObject | None = None, bcs: ndarray | GridObject | None = None, dt: float = 0.001, p: float | ndarray | GridObject = 2.777777777777778e-06, manning: float | ndarray | GridObject = 0.033, sfd: bool = False, d8: bool = True, n_iterations: int = 100)[source]#
Runs the full graphflood’s algorithm as described in Gailleton et al., 2024
- Parameters:
grid (GridObject) – A GridObject representing the digital elevation model.
initial_hw (np.ndarray or GridObject, optional) – Flow depth. Default is a matrix filled with zeros and the same shape as ‘grid’.
BCs (np.ndarray or GridObject, optional) – Boundary codes. Default is a matrix filled with ones except for the outermost edges, where values are set to 3, has same shape as ‘grid’
dt (float, optional) – time step(s ~ although this is not simulated time as we make the steady low assumption). Default is 1e-3.
P (float, np.ndarray, or GridObject, optional) – Precipitation rates in m.s-1 Default is a matrix with the same shape of ‘grid’ filled with 10 * 1e-3 / 3600.
manning (float, np.ndarray, or GridObject, optional) – Friction coefficient. Default is a matrix with the same shape as ‘grid’ filled with 0.033.
SFD (bool, optional) – True to compute single flow directions, False to compute multiple flow directions. Default is False.
D8 (bool, optional) – True to include diagonal paths. Default is True.
N_iterations (int, optional) – Number of iterations for the simulation. Default is 100.
- Returns:
A grid object with the computed water depths.
- Return type:
- Raises:
RuntimeError – If the shape of initial_hw, BCs, P, or manning does not match the shape of the ‘grid’ GridObject`.