Synthetic CML network + synthetic wet/dry + synthetic rainfall intensity -> IDW interpolation -> PNGs.
This is a small standalone testbed to stress-test TelcoRain-like interpolation behaviour without InfluxDB/MariaDB.
pip install numpy pandas scipy matplotlibpython run_scenarios.py --out out_demo --seed 0 --city --n-sites 250 --mean-degree 3 \
--wet-target 0.35 --wet-mode threshold --flip-dry-to-wet 0.03 --flip-wet-to-dry 0.15 \
--grid-step-m 1000 --idw-dist-m 30000 \
--idw-near 12 --idw-power 2.0 --dry-as-zeroOutputs (in out_demo/):
true_field.png: underlying synthetic “ground truth” rainfall fieldlinks.png: link centers with wet/dry markersidw_field.png: interpolated rainfall field from linksdiff.png: interpolated minus true (useful for bias/artefacts)
Use --dry-as-zero to force dry links as 0 mm/h (strongly affects IDW output).
Omit --dry-as-zero to ignore dry links (IDW uses only wet links).
- Bbox is
lon_min,lon_max,lat_min,lat_max(degrees). Default is a rough Czechia bbox. - Grid is built in meters using Web Mercator (like TelcoRain with
use_mercator=True). Use--grid-step-m(e.g. 1000 for ~1 km) and--idw-dist-m(e.g. 30000 for 30 km). If you really want to do everything in degrees, pass--no-mercator(not recommended). - Wet/dry labeling:
--wet-mode threshold: picks a threshold so ~wet_targetlinks are wet (can create contiguous wet/dry regions).--wet-mode random: wet labels are i.i.d. random.--wet-mode stratified: random within coarse spatial strata (--wet-strata-nx/ny) to spread wet links evenly.
Instead of passing many CLI flags, you can use:
python run_scenarios.py --config example_config.iniCLI flags override config values, e.g.:
python run_scenarios.py --config example_config.ini --wet-target 0.15 --seed 3This matches TelcoRain’s behaviour:
idw_dist_msets a maximum radius (meters) for eligible neighbours.idw_nearcaps the maximum number of neighbours actually used per grid point (after filtering by radius).
In dense networks, without idw_near, a 30 km radius could include hundreds/thousands of links per pixel.
wet_mode=threshold: wet links are chosen by rainfall intensity quantile (can create coherent wet regions).wet_mode=random: wet links are chosen uniformly at random (spatially “salt-and-pepper”).wet_mode=stratified: random wet selection within coarse spatial bins (more spatially balanced than pure random).
This output was financed through the project Precipitation Detection and Quantification System Based on Networks of Microwave Links (SS06020416) is co-funded with state support from the Technology Agency of the Czech Republic under the Environment for Life Programme. The project was further funded within the National Recovery Plan from the European Recovery and Resilience Facility.

