Flow Workbench

The Workbench answers questions about a set of gages together, over periods you define: how much a diversion averaged against its lease maximum, how many days a river met an instream-flow rule, how this season compares with the record, how much water passed in acre-feet. You describe the situation once as a scenario, and ten panels read it. Every panel is a grid you can export.

It does not replace the Compare tab. Compare is the quick overlay: pick gages, pick a range, look at the lines. The Workbench is the accounting surface — slower to set up, and it answers questions a chart cannot.

Scenarios

A scenario is the input side of the Workbench, saved under a name so the same analysis reruns next month without rebuilding it. It holds:

  • Gages and roles. Which gages, and what each one is in this story: the control (the river the leases are keyed to), a diversion, the upstream or downstream end of a reach, a return. Roles are labels the panels use to offer sensible defaults; no arithmetic is inferred from them.
  • A window and a timezone. The timezone matters more than it looks: it decides where one day ends and the next begins. A season averaged on Pacific days is not the same number as one averaged on UTC days, and lease accounting is written in local days.
  • Periods. Named date spans — a payment period, a water availability period, a critical period. Panels report per period.
  • Groups. Named sets of gages that are totalled together, for a combined diversion row.
  • Lease maxima, threshold schedules, reach wiring and pairs — the inputs the individual panels need.

Start from a template rather than a blank scenario. Templates are shaped around a question, not around particular gages: you pick which of your tracked gages fills each slot, and the numbers a template ships (rule values, for instance) are editable placeholders, never assertions about your river.

Editing and applying

Editing is deliberate. Changes go to a working copy; Apply recomputes the panels against them without saving, and Save writes the scenario. That split lets you try a threshold against real data before committing to it. A panel is a heavy computation over up to twenty gages and five years, so nothing recomputes while you type.

The panels

Ledger

Period by period, subject by subject: mean, median, extremes, volume in acre-feet, the lease maximum you entered, the remainder, and whether the period is confirmed within it. A group carries two totals — one that sums members day by day and then averages, and one that averages each member over the period and then sums. They differ when members have different missing days, and the ledger shows both rather than choosing for you.

Compliance

Instream-flow rules are schedules, not single numbers: so many cfs from November, fewer from April, fewer again in late summer, sometimes with a "half of what the river is doing, never below a floor" term on top. A threshold here is a list of date spans, which may wrap the year, plus an optional ratio term. The panel reports every day as met, breached, missing or outside any rule, and groups the breaches into runs.

A day with no reading is never counted as met and never as breached, and a gap breaks a run rather than continuing it: an unmeasured day is not evidence the excursion carried on.

Duration

The flow-duration curve — what fraction of days carried at least a given flow — at the plotting positions USGS uses. An exceedance the record is too short to reach is left blank rather than filled with the extreme day.

Envelope

Day-of-year percentile bands from a gage's own record, with the window laid over them, each day placed as a numeric percentile and as a flow class in the familiar much-below-normal to much-above-normal scale. Three water years of record are required before any band is drawn.

Overlay, Volume and Ratio

Water years on one axis for shape comparison; cumulative volume as a mass curve, per subject and per period; and diversion-to-mainstem ratios, which report both the average of the daily ratios and the ratio of the averages.

Reach, Double mass and Lag

Reach gain and loss is the residual of the water balance between two gages, with metered diversions added back so a headgate is not mistaken for seepage. Double mass plots one gage's cumulative flow against another's: a consistent pair is a straight line, and a kink dates a likely rating shift. Lag correlates one gage against another across a range of shifts to estimate travel time.

Exporting

Every panel has Download CSV and Copy above its grid, and they write exactly the rows on screen. The Export workbook button builds one spreadsheet with a sheet per panel plus an Inputs sheet recording the scenario, the window, the timezone, the gages and how each panel's numbers were produced — including any gage that fell back to UTC days. It is built on a worker and appears in the Exports tab like every other export.

What the numbers rest on

Panels read daily means, and period-of-record statistics always read UTC days, because that is the form long-term storage keeps. When a scenario's timezone is not UTC, days are rebuilt from hourly data so the boundaries are local — and if a gage lacks hourly coverage over the window, that gage falls back to UTC days and says so in the provenance line above the grid. Read that line before quoting a figure: it is the difference between a number you can defend and one you cannot.

Readings the source flagged as bad are excluded throughout. A day with no reading is missing, never zero, and every panel reports how many days were missing beside the statistic computed from the rest.

The Workbench is a tool, not an authority. Its arithmetic is transparent and its inputs are yours. Compliance findings, lease settlements and regulatory filings should rest on the source agency's finalized record and on the methodology your agreement specifies.