The idea for SplashTool was floating around, along with the key libraries needed for implementation. The project will be developed in the programming language Python. This language provides efficient implementation through its extensive library ecosystem. Additionally, as the standard scripting language in both QGIS and ArcGIS, it’s widely adopted in heavy rainfall analysis.
It became clear relatively quickly that the analysis should be based on raster data. GDAL serves as the library for reading and writing GeoTIFF files, while the actual iterative analysis is performed using NumPy, which features numerous mathematical functions and computation routines optimized for speed.
Key parameters of the iteration are
- Terrain elevation
- Water depth
- Sum of outflows per cell over the course of the iteration
A key aspect in the development is calculating the flow between cells from one iteration step to the next. After testing the numpy.gradient function, I decided to implement a custom difference approach, where the flow between cells is determined based on the differences in absolute water levels between neighboring cells.
diff_sum = dy_up + dy_down + dx_up + dx_down
wl_flow = diff_sum / 4
# however, water flow cannot be more than
# the water level in the cell
wl_flow = np.where(wl_flow > self.wd, self.wd, wl_flow)
# update water level in the center cells
self.wd -= wl_flow
# add the outflow to flow accumulation raster
self.flowacc += wl_flow
The complete iteration is now described in the documentation.

