hydromodpy.solver.modflow_common.calibration_extractors#

Lightweight binary readers for calibration trials.

During a calibration trial, the solver writes .hds and .cbc to the scratch folder but no Zarr / Parquet rows are produced. The optimizer needs the simulated series ASAP to score one trial — these helpers read the binary files directly and return a pd.Series aligned with the simulation time grid. Both MODFLOW-NWT and MODFLOW 6 use the same binary layout, so the same helpers are reused across the two backends.

Functions

drain_budget_array_to_positive_outflow_by_cell(...)

Convert one signed DRAIN budget array to positive per-cell outflow.

extract_discharge_from_cbc(output_dir, ...)

Sum the DRAIN budget component per timestep and return a m3/s series.

extract_drain_outflow_by_cell_from_cbc(...)

Return positive DRAIN outflow by timestep and cell in m3/s.

extract_head_from_hds(output_dir, ...[, ...])

Return head timeseries keyed by station at the given (k, i, j) cells.