Expand description
hydro-platform: multi-model orchestration for the hydrology platform.
Runs multiple hydrological models (新安江 / TOPMODEL / SWAT / API-CONT) on the same basin + forcing, collects discharge hydrographs, and computes comparison metrics (NSE / KGE / RMSE / PBIAS / R²) plus ensemble probabilistic verification (CRPS / Brier / POD-FAR-CSI / Talagrand rank histogram) and GB/T 22482-2008 flood-forecast qualification.
§Re-exports
hydro-platform is the orchestration layer of the hydro-suite crates and
pulls the rest of the suite in as dependencies. From this one crate you get,
via re-export:
- From
hydro_core: theHydroModel/DynHydroModeltraits, forcing types (Forcing,BasinInfo,Outlet), theModelTypeenum, the full metrics toolkit (compute_metrics,compute_metrics_gbt,crps,brier,pod_far_csi,rank_histogram, …), and the GB/T 22482 qualification types. - From
hydro_calib: thecalibrateentry point,ParamSpec,Objective,Method,SceConfig,CalibResult. - The four model crates themselves (
hydro_xinanjiang,hydro_topmodel,hydro_swat,hydro_apicont) are dependencies ofhydro-platformand used internally bycreate_model/run_scenario; reach into them directly (use hydro_xinanjiang::XinanjiangParams;) when you need to construct parameter structs.
§Workflow
- Build a
Scenario(basin, forcing, dt_h, selected models, optional observation, optional per-model parameter overrides). - Call
run_scenarioto get aComparisonResult— oneModelResultper selected model (discharge series + optional metrics when an observation was supplied). - Inspect per-model hydrographs, call
ComparisonResult::best_nsefor the best-fitting model, or feed the result intoensemble_stats/ensemble_probabilistic/ensemble_rank_histogramfor multi-model ensemble verification.
Structs§
- Basin
Info - Static basin / sub-basin metadata shared across all models.
- Calib
Result - 率定结果(参数 JSON + 最优分数 + 评估次数 + 收敛历史)。
- Comparison
Result - Comparison output from running every model in a
Scenario. - Ensemble
Stats - Per-time-step ensemble statistics across all members of a
ComparisonResult. - Forcing
- Per-timestep meteorological forcing for a sub-basin or grid cell.
- GbtEvent
Errors - Per-event GB/T 22482-2008 flood-forecast errors (relative errors in %, peak-timing error in time-steps).
- Metrics
Report - Full metrics report for one model’s simulation vs observation.
- Model
Result - A single model run result: discharge hydrograph + optional evaluation metrics.
- Outlet
- Outlet section descriptor.
- Param
Spec - 单个率定参数:JSON 字段名 + 区间(归一化
x∈[0,1]映射到[min,max])。 - Probabilistic
Report - Ensemble probabilistic verification report.
- Qualification
Report - Aggregated qualification report across many flood events.
- Qualification
Tolerance - GB/T 22482-2008 qualification tolerance for a single flood event.
- SceConfig
- SCE-UA 配置(默认:complexes=5,每 complex m=2n+1 点,subcomplex q=n+1)。
- Scenario
- A forecast scenario: basin + forcing + selected models + optional observation + optional per-model parameter overrides.
Enums§
- Method
- 率定方法。
- Model
Type - Identifier for the four distributed hydrology models orchestrated by the platform crate.
- Objective
- 率定目标(皆“越大越好“;RMSE 取负)。
Traits§
- DynHydro
Model - Object-safe wrapper so the platform can hold
Vec<Box<dyn DynHydroModel>>for heterogeneous multi-model comparison. - Hydro
Model - The core trait every distributed hydrological model implements.
Functions§
- brier
- Brier score for the threshold-exceedance probability.
- calibrate
- 模型率定入口。
make_model:每次调用返回一个全新默认模型(闭包内 create_model)。 - compute_
metrics - Compute all deterministic scores at once.
gbtandqualifiedare left asNone(usecompute_metrics_gbtto populate them). - compute_
metrics_ gbt - Compute all deterministic scores plus GB/T 22482-2008 event errors and qualification under the supplied tolerance.
- compute_
probabilistic - All-in-one ensemble probabilistic verification.
- create_
model - Factory: create a boxed
DynHydroModelfrom aModelTypetag + a JSON params blob. - crps
- Fair Continuous Ranked Probability Score (Gneiting & Raftery 2007; Ferro 2017), averaged over time-steps.
- default_
params - Get the default params for a model type as a JSON
Value. - ensemble_
exceedance - Per time-step exceedance probability,
|{m : m[t] > threshold}| / M. - ensemble_
probabilistic - Ensemble probabilistic verification against an observed series at a
discharge
threshold. - ensemble_
rank_ histogram - Talagrand rank histogram (ensemble reliability) for the multi-model ensemble vs an observed series.
- ensemble_
stats - Compute per-time-step ensemble statistics across all members of
res. - event_
errors - Compute the GB/T 22482-2008 event errors for one flood.
- event_
qualified - Decide whether a single event is 合格 (qualified) under the given tolerance: all three errors (peak, peak timing, runoff depth) must be within bounds.
- event_
uh_ forecast - Event-based unit-hydrograph forecast: rainfall hyetograph
rain_mm(per time-step) convolved with a unit hydrographuh(a normalised kernel,Σ uh = 1) → outlet discharge hydrograph in m³/s. - pod_
far_ csi - Threshold-exceedance contingency table →
(POD, FAR, CSI). - qualification_
grade - GB/T 22482-2008 grade for the qualification rate.
- qualified_
rate - Aggregate per-event qualified flags into a
QualificationReport. - rank_
histogram - Talagrand rank histogram (verification rank histogram).
- run_
model_ default - Run a single model with default parameters and return its discharge hydrograph (m³/s, one entry per forcing step).
- run_
scenario - Run all selected models in
scenarioon the same forcing and collect hydrographs + (optional) evaluation metrics. - scheme_
grade - Overall scheme grade = the lower of the DC grade and the qualification-rate grade. 丙 is the minimum grade acceptable for operational flood-forecast services.
- scs_
unit_ hydrograph - SCS-style dimensionless unit hydrograph, simplified to a triangular UH:
linear rise to the peak at index
peak_t, linear recession to zero at indexbase_t - 1, then normalised soΣ uh = 1.