Geoskill: Reservoir Capacity Change

Establish level-area-storage relationships from multi-period water surface, DEM, and water level data. Monitor reservoir capacity change and sedimentation trends. Use when analyzin…

ruiduobao

@ruiduobao

Install

$ openclaw skills install @ruiduobao/geoskill-reservoir-capacity-change

Reservoir Capacity Change

Combines multi-period water surface extent, DEM, and water level data to establish level-area-storage relationships, monitoring capacity change and sedimentation trends.

Trigger

Use when the user wants to:

  • Estimate current reservoir capacity from DEM and water level data
  • Analyze area-level relationships over time for sedimentation signals
  • Compute storage curves and their uncertainty
  • Compare storage between two periods
  • Generate water extent time series from DEM + water levels

CLI Usage

# Synthetic demo mode (no input files needed)
python scripts/reservoir_capacity_change.py --output-dir ./rcc-output

# With input DEM GeoTIFF
python scripts/reservoir_capacity_change.py \
  --dem ./data/reservoir_dem.tif \
  --water-levels ./data/water_levels.csv \
  --output-dir ./rcc-output

# With bounding box for area computation
python scripts/reservoir_capacity_change.py \
  --dem ./data/dem.tif \
  --bbox 116.0 39.5 116.5 40.0 \
  --output-dir ./rcc-output

# With vertical datum specification
python scripts/reservoir_capacity_change.py \
  --dem ./data/dem.tif \
  --dem-datum WGS84 \
  --water-level-datum WGS84 \
  --confidence 0.99 \
  --mc-iterations 1000 \
  --output-dir ./rcc-output

Parameters

ParameterDefaultDescription
--demNonePath to DEM GeoTIFF
--water-levelsNonePath to water levels CSV (date, level columns)
--reservoir-boundaryNonePath to reservoir boundary GeoJSON/Shapefile
--placeNonePlace name for AOI lookup
--bboxNoneBounding box: xmin ymin xmax ymax
--aoi-fileNonePath to AOI geometry file
--start-dateNoneStart date (ISO 8601)
--end-dateNoneEnd date (ISO 8601)
--datesNoneList of dates
--curve-methodtrapezoidalCurve method: trapezoidal, prism
--reference-levelNoneReference elevation level (m)
--dem-error5.0DEM vertical RMSE (meters)
--water-level-error0.3Water level measurement error (meters)
--water-body-error1.0Water boundary delineation error (pixels)
--mc-iterations500Monte Carlo iterations
--mc-seed42Monte Carlo random seed
--confidence0.95Confidence level for uncertainty
--dem-datumNoneDEM vertical datum
--water-level-datumNoneWater level vertical datum
--output-dir./rcc-outputOutput directory

Output

FileDescription
area_level_curve.csvElevation-area relationship
storage_curve.csvElevation-area-storage curve
storage_timeseries.csvStorage time series
water_extent_timeseries.csvWater extent time series
uncertainty.jsonMonte Carlo uncertainty analysis
request.jsonAnalysis request metadata
dataset-manifest.jsonDataset inventory
output-manifest.jsonOutput file inventory
qa.jsonQuality assurance checks

Curve Methods

MethodDescriptionFormula
trapezoidalArea by pixel counting, storage by trapezoidal integrationV(h) = integral of A(h) dh
prismDirect prism summation per pixelV(h) = sum(max(h - DEM_i, 0)) * pixel_area

Key Algorithms

Area at Level

Counts pixels with elevation <= water level, multiplied by pixel area. Handles both projected and geographic CRS (latitude correction).

Storage at Level (Prism Method)

For each inundated pixel, computes water depth = level - elevation, then sums depth * pixel area across all inundated pixels.

Trapezoidal Integration

Computes area at each level, then integrates using trapezoidal rule: V(h_i) = V(h_{i-1}) + (A_i + A_{i-1}) / 2 * dh

Monotonicity Enforcement

Area and storage curves are enforced non-decreasing by cumulative maximum.

Monte Carlo Uncertainty

Propagates DEM vertical error, water level measurement error, and water boundary delineation error through Monte Carlo simulation. Produces confidence intervals at each elevation level.

Exit Codes

CodeMeaning
0Success
2Argument error
3Dependency missing
6Data validation failure
7Processing failure

Limitations

  • Public DEMs (SRTM, Copernicus DEM) represent post-impoundment topography and cannot capture original reservoir basin shape
  • Sediment deposition alters topography over time; single DEM cannot represent multi-period bathymetry
  • Water level and satellite image dates may not coincide exactly
  • Mixed pixel effects at water boundaries cause area uncertainty
  • Relative storage change is more reliable than absolute storage volume
  • Absolute storage requires known vertical datum and calibration data
  • Outputs are analysis aids; engineering safety decisions require human review

References

  • Sawunyama, T. (2009). Estimating storage in reservoirs using remote sensing. IAHS Publ. 333.
  • Zhang, S. et al. (2014). Capability evaluation of retrieving reservoir parameters from satellite imagery.
  • McFeeters, S.K. (1996). The use of Normalized Difference Water Index. Remote Sensing.

数据下载

本 skill 可自动从 Microsoft Planetary Computer 下载数据 (无需 API key):

python reservoir_capacity_change.py --bbox 116,39,117,40 --date-range 2024-06-01,2024-06-30 --output-dir <tmp>
  • --bbox W,S,E,N: WGS-84 边界框 (西, 南, 东, 北)
  • --date-range START,END: 日期范围 (YYYY-MM-DD,YYYY-MM-DD)
  • --aoi-file <path.geojson>: 替代 --bbox 的 GeoJSON 多边形
  • --cache-dir <path>: 缓存目录 (默认 ~/.geoskill_cache)

当用户只给 --bbox + --date-range (没有 --dem) 时,skill 自动下载数据。 当用户给 --dem 时,走原文件路径 (向后兼容)。

Top skills in this category