hydromodpy.calibration.metrics.solver_extract#

Solver-bridge extractors used by metric extractors.

Resolves the active flow SolverAdapter from a trial context and pulls calibration series (point, boundary, cell). Also owns the station-to-cell mapping helpers that locate observation stations on a structured grid.

Functions

call_extract_calibration_series(adapter, ...)

Call an adapter while enforcing explicit boundary filtering support.

extract_boundary(ctx, output)

Extract a boundary time series filtered by boundary_id.

extract_cell(ctx, output)

Extract a head time series at an explicit cell selector.

extract_point(ctx, output)

Extract a head time series at the (x, y) point declared on output.

find_cell_at_point(ctx, x, y)

Return the closest (layer, row, col) to (x, y) on layer 0.

point_xy_from_output(output)

Return planar point coordinates from an output declaration.

resolve_flow_adapter(trial_ctx)

Return (adapter, run_ctx) for the active flow run, or None.

resolve_station_cells(ctx, observed)

Resolve station ids to structured (layer, row, col) cells.

slice_time(values, time, reducer)

Apply time selector and reducer to a 1D array of simulated values.