iwfm.calib.divshort2obs¶
- iwfm.calib.divshort2obs(budget_file, reach_file, nwidth=20)[source]¶
Convert diversion shortages from IWFM Stream Budget to the SMP file format for use by PEST.
(Based on STACDEP2OBS.F90 by Matt Tonkin, SSPA with routines by John Doherty.)
Reads
budget_fileandreach_file, then delegates the SMP/INS formatting toformat_divshort_smp(). Use that helper directly if you already have parsed budget data.- Parameters:
- Returns:
divshort (list) – Diversion shortage values for each group in SMP format.
ins (list) – Corresponding PEST instructions for the SMP file.
- Raises:
FileNotFoundError – If
reach_filedoes not exist.IndexError – If any group references a reach number beyond the budget file’s reach count (propagated from
format_divshort_smp()).ValueError – If the budget or reach file is malformed (numeric tokens fail to parse).