## 4 HydroSAR Product Portfolio and Product Algorithms
### Quantitative HydroSAR Flood Information Products
#### 4.3.2 WD30: Water Depth  
The HydroSAR 30 m water depth product WD30 is computed based on HAND and the HYDRO30 water extent product described in Section 4.3.1. The calculation is performed separately for each independent water patch. Our WD30 workflow is shown in Figure 7a and consists of the following steps.  
**Step 1: Fetching HYDRO30 and HAND from HydroSAR Cloud Storage**. While any GDAL-compatible binary raster can be used to generate a water depth map, the HYDRO30 products were used as fundamental inputs for WD30 calculation. HYDRO30 and the HydroSAR HAND products were fetched from the HydroSAR cloud storage bucket to prepare for water depth derivation. HAND products were clipped to match the coverage of the HYDRO30 products.  
**Step 2: Integrating Water Extent Maps and Perennial Water Layer**. We combined the perennial water layer mentioned in Section 4.3.1 with the observed water extent maps to ensure gap-free coverage of perennial water bodies. Gaps in the SAR-based water extent maps may have occurred due to man-made structures such as bridges or dams or due to overhanging vegetation. The primary role of the perennial water layer is to close potential gaps and connect water bodies which are expected to be connected. This was achieved by first finding the maximum percent occurrence (i.e., smallest areal extent) covering 68% of the observed water extent in the HYDRO30 product. The thresholded perennial water layer was then merged with the observed water extent. Note that the final WD30 extent matched the HYDRO30 extent if the perennial water pixels used to link connected water bodies were removed.  
Figure 7: (**a**) The workflow of water depth estimation and (**b**) an image showing the terms used in the workflow.  
**Step 3: Water Height Estimation using Basin Hopping**. Water depths were estimated using the basin hopping algorithm [51], an iterative estimator which identifies the optimal match between the observed water extent and simulated water extent provided by the HAND grid and the maximum water height (Figure 7b). The basin hopping algorithm tries to find the best matching surface water extent by flooding HAND at different water levels and comparing the resulting extent with that of the HYDRO30 product. The search space was bounded to be between 0 and 15 m (matching the bounds used in HYDRO30; Section 4.3.1), and the basin hopping step size was set to 3 m. This basin hopping step size reduced the likelihood of the algorithm converging to a local minimum, which manifested itself as varying results in repeated basin-hopping runs, which by default had random initial seeds. Once the best-fitting water height was estimated, the water depth was calculated by subtracting the HAND from the estimated water height (Figure 7b), and any additional pixels added by the perennial water mask were removed. If desired, the product could be further masked by removing areas with permanent surface water to obtain a flood depth product rather than a water depth product. An example of a WD30 product is shown in Figure 5d. A performance assessment of this product is presented in Section 7.