Back to skills
SKILL.md
Docs
ASecurityBuild the river network topology NetCDF that defines every reach and its contributing catchment (HRU). This is the core spatial input for mizuRoute.
- 200 stars
- 0 votes
- 0 copies
- 2 views
- Added September 11, 2026
Works with
Security analysis
100/100Pro scans all 13 files and shows the line behind each finding
npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-codeAre you the author of Docs?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/lzwei196-docs-0a7a4e90)# Stage 1: River Network Topology Construction
## Purpose
Build the river network topology NetCDF that defines every reach and its contributing catchment (HRU). This is the core spatial input for mizuRoute.
If skipped: mizuRoute has no river network to route through.
## Prerequisites
- [ ] Basin shapefile exists
- [ ] DEM available (China 90m or Copernicus GLO-30)
- [ ] WhiteboxTools installed (in HydroCraft python_env)
## Procedure
1. **Run build_network_topology.py**:
```bash
python tools/s1_network/build_network_topology.py \
--basin_shp <shapefile> --dem <dem_path> \
--output network_topology.nc \
--stream_threshold 500 --min_slope 0.0001
```
2. **Stream threshold selection guide**:
| Basin area | Recommended threshold | Approx. reaches |
|-----------|----------------------|-----------------|
| < 1,000 km2 | 100-300 | 20-100 |
| 1,000-10,000 km2 | 300-1000 | 50-500 |
| 10,000-100,000 km2 | 1000-5000 | 200-2000 |
| > 100,000 km2 | 5000-20000 | 1000-10000 |
Higher threshold = fewer, longer reaches = faster routing.
3. **Validate topology**:
- Exactly one outlet (tosegment=0)
- All tosegment references exist in seg_id
- All seg_slope > min_slope
- All seg_length > 0
## Common Pitfalls
- **Multiple outlets (dt_m015)**: DEM extraction near basin boundary creates extra outlets. Fix by connecting secondary outlets to main outlet.
- **Zero slope (dt_m007)**: Flat terrain gives slope=0. Apply minimum 0.0001 m/m.
- **Wrong width estimation (dt_m018)**: Default Leopold coefficients are for temperate. Adjust for climate zone.
- **Too many reaches**: Very low threshold creates thousands of reaches, slowing routing. Start with threshold=500 and adjust.
Files in this skill
- REFERENCES.md
- format_spec.yaml
- papers.json
- s0_config_skill.md
- s1_network_skill.md
- s2_remap_skill.md
- s3_runoff_skill.md
- s4_control_skill.md
- s5_execution_skill.md
- s6_comparison_skill.md
- s_lake_routing_skill.md
- validation_convention.yaml
Attribution
Comments
Loading comments…