Compare a run with flood observations
get_observation_comparisonCompare a flood simulation run with project observations to measure fit: returns residual statistics, bias, RMSE, tolerance counts, gauge errors, and datum warnings.
Instructions
Compare a run with the project's flood observations: how well does it match them?
Returns headline (the figures to tell the user, e.g. "47 observations · 31
within ±0.30 m (66%) · bias -0.12 m · RMSE 0.35 m · 1 excluded"),
headline_numbers (the same as numbers), tolerance_m (used) and
default_tolerance_m (the project's saved one), statistics
(the API's summary: n, within, within_pct, bias_m, rmse_m, weighted_rmse_m, mae_m, max_abs_m,
excluded, not_scored by reason, gauges), gauges (Gauge records: peak error,
timing error, NSE), datum_checks (warn the user only when warning is true:
both datums known and different; not_recorded = the terrain has no
recorded datum, stated in note, not a warning)
and one row per observation: observed_m / modelled_m / residual_m (modelled -
observed, + = model high), within, scored / not_scored_reason, match
(outside_run_window = not this flood), excluded + exclusion {reason, by, at}.
sampling counts how the modelled values were read: centroid (the peak
of the mesh triangle the observation sits in), nearest_node_fallback (an
older run without that peak: the nearest mesh node's value, tell the user)
and nearest_node (just outside the mesh); each row's sample.method says
which.
There is no pass or fail: report the figures. A run that is not historic has
none (has_comparison false) — do not retry it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fid | No | With layer_id: the observation's fid (list_observations) | |
| run_id | Yes | The run ID (a historic run; others are not compared with observations) | |
| layer_id | No | With fid: narrow the rows to ONE flood observation and add its history | |
| tolerance | No | Metres within which a residual counts as within (default: the project's saved tolerance, 0.3 unless an Editor changed it; presets 0.15, 0.3, 0.4; above 0 and at most 5). Not stored: it only changes this answer | |
| include_series | No | Keep each Gauge record's modelled stage series (every saved frame); default false |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||