Install
openclaw skills install @ruiduobao/geoskill-water-balance-calculation逐像元水量平衡计算 P = ET + Q + ΔS,评估闭合差。Per-pixel water balance computation P = ET + Q + ΔS with closure residual assessment. 输出各分量/闭合差 GeoTIFF + 报告 JSON。
openclaw skills install @ruiduobao/geoskill-water-balance-calculationPer-pixel water balance computation, with the core equation:
P = ET + Q + ΔS
i.e. Precipitation = Evapotranspiration + Runoff + Change in Storage. For each pixel, every component is computed independently and the closure residual is derived:
residual = P − ET − Q − ΔS
Under perfect closure the residual is 0; with real observational data a residual remains because the components come from different sources (precipitation station networks, remote-sensing evapotranspiration products, hydrological model runoff, gravity-satellite storage change). This skill uses the relative closure error (mean|residual| / mean P) to quantify data consistency — a common way to diagnose the quality of multi-source hydrological data and identify systematic biases, applicable to watershed water-balance diagnosis, cross-validation of remote-sensing products, and quality assessment prior to data assimilation.
The --synthetic mode generates a complete dataset that is physically closed (ET≈0.45P, Q≈0.30P, ΔS as the closing residual, plus observational perturbation with std≈3 mm), so the pipeline can be validated without network access or real data; the relative closure error of synthetic data should be < 2%.
pip install numpy rasterio scipy
python geoskill-water-balance-calculation.py --bbox 116.0 39.0 117.0 40.0 --output-dir ./output
python geoskill-water-balance-calculation.py \
--bbox 116.0 39.0 117.0 40.0 \
--synthetic \
--output-dir ./wb_syn
python geoskill-water-balance-calculation.py \
--input precip_annual.tif \
--output-dir ./wb_real
(With the input precipitation as P, the remaining components are synthesized in empirical proportions to demonstrate the workflow.)
python geoskill-water-balance-calculation.py --bbox 121 31 122 32 --synthetic --output-dir ./wb_sh --quiet
python geoskill-water-balance-calculation.py --bbox 116.39 39.90 116.40 39.91 --synthetic --output-dir ./wb_tiny --quiet
| File | Format | Description |
|---|---|---|
balance_components.tif | GeoTIFF (float32, 4 bands) | Component rasters: B1=P, B2=ET, B3=Q, B4=ΔS, EPSG:4326 |
closure_residual.tif | GeoTIFF (float32) | Closure residual P−ET−Q−ΔS |
water_balance_report.json | JSON | Component means, closure residual mean/std, relative closure error, volumetric quantities |
output-manifest.json | JSON | Run manifest (inputs/outputs/QA/software versions) |
--synthetic mode reads no external dataMIT
逐像元水量平衡计算,核心方程:
P = ET + Q + ΔS
即 降水 = 蒸散发 + 径流 + 蓄水变化。对每个像元独立计算各分量,并求闭合差 (closure residual):
residual = P − ET − Q − ΔS
理想闭合时残差为 0;真实观测数据因各分量来自不同数据源(降水站网、遥感蒸散发 产品、水文模型径流、重力卫星蓄水变化)而存在残差。本 skill 用相对闭合误差 (mean|residual| / mean P)量化数据一致性,是诊断多源水文数据质量、识别系统 偏差的常用手段,适用于流域水平衡诊断、遥感产品交叉验证、数据同化前的质量评估。
支持 --synthetic 模式生成物理闭合(ET≈0.45P、Q≈0.30P、ΔS 为闭合残值,
再叠加 std≈3 mm 的观测扰动)的完整数据集,无需网络和真实数据即可验证流程,
合成数据的相对闭合误差应 < 2%。
pip install numpy rasterio scipy
python geoskill-water-balance-calculation.py --bbox 116.0 39.0 117.0 40.0 --output-dir ./output
python geoskill-water-balance-calculation.py \
--bbox 116.0 39.0 117.0 40.0 \
--synthetic \
--output-dir ./wb_syn
python geoskill-water-balance-calculation.py \
--input precip_annual.tif \
--output-dir ./wb_real
(以输入降水为 P,其余分量按经验比例合成以演示流程。)
python geoskill-water-balance-calculation.py --bbox 121 31 122 32 --synthetic --output-dir ./wb_sh --quiet
python geoskill-water-balance-calculation.py --bbox 116.39 39.90 116.40 39.91 --synthetic --output-dir ./wb_tiny --quiet
| 文件 | 格式 | 说明 |
|---|---|---|
balance_components.tif | GeoTIFF (float32, 4 bands) | 分量栅格:B1=P, B2=ET, B3=Q, B4=ΔS,EPSG:4326 |
closure_residual.tif | GeoTIFF (float32) | 闭合差 P−ET−Q−ΔS |
water_balance_report.json | JSON | 各分量均值、闭合差均值/标准差、相对闭合误差、体积量 |
output-manifest.json | JSON | 运行清单(输入/输出/QA/软件版本) |
--synthetic 模式不读取任何外部数据MIT