Skip to main content

Crate hydro_platform

Crate hydro_platform 

Source
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:

§Workflow

  1. Build a Scenario (basin, forcing, dt_h, selected models, optional observation, optional per-model parameter overrides).
  2. Call run_scenario to get a ComparisonResult — one ModelResult per selected model (discharge series + optional metrics when an observation was supplied).
  3. Inspect per-model hydrographs, call ComparisonResult::best_nse for the best-fitting model, or feed the result into ensemble_stats / ensemble_probabilistic / ensemble_rank_histogram for multi-model ensemble verification.

Structs§

BasinInfo
Static basin / sub-basin metadata shared across all models.
CalibResult
率定结果(参数 JSON + 最优分数 + 评估次数 + 收敛历史)。
ComparisonResult
Comparison output from running every model in a Scenario.
EnsembleStats
Per-time-step ensemble statistics across all members of a ComparisonResult.
Forcing
Per-timestep meteorological forcing for a sub-basin or grid cell.
GbtEventErrors
Per-event GB/T 22482-2008 flood-forecast errors (relative errors in %, peak-timing error in time-steps).
MetricsReport
Full metrics report for one model’s simulation vs observation.
ModelResult
A single model run result: discharge hydrograph + optional evaluation metrics.
Outlet
Outlet section descriptor.
ParamSpec
单个率定参数:JSON 字段名 + 区间(归一化 x∈[0,1] 映射到 [min,max])。
ProbabilisticReport
Ensemble probabilistic verification report.
QualificationReport
Aggregated qualification report across many flood events.
QualificationTolerance
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
率定方法。
ModelType
Identifier for the four distributed hydrology models orchestrated by the platform crate.
Objective
率定目标(皆“越大越好“;RMSE 取负)。

Traits§

DynHydroModel
Object-safe wrapper so the platform can hold Vec<Box<dyn DynHydroModel>> for heterogeneous multi-model comparison.
HydroModel
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. gbt and qualified are left as None (use compute_metrics_gbt to 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 DynHydroModel from a ModelType tag + 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 hydrograph uh (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 scenario on 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 index base_t - 1, then normalised so Σ uh = 1.