Skip to content

Add gage-constrained correlated SFOI integration - #67

Open
RaidoYAGAMI wants to merge 10 commits into
mainfrom
gage-correlation
Open

Add gage-constrained correlated SFOI integration#67
RaidoYAGAMI wants to merge 10 commits into
mainfrom
gage-correlation

Conversation

@RaidoYAGAMI

Copy link
Copy Markdown
Collaborator

No description provided.

RaidoYAGAMI and others added 10 commits July 28, 2026 11:37
The integrator hydrograph was regenerated by evaluating the refitted flow
law on the SWOT geometry.  That fit only constrains two moments of the
series, so a 2-3 parameter flow law was being asked to reproduce a full
hydrograph from qbar and q33 alone -- every bit of temporal information
the FLPE algorithm produced was discarded, and the inversion is badly
underdetermined.

calc_integrator_hydrographs() instead keeps the FLPE hydrograph's shape
and shifts only its level:

    q = q_FLPE * (qbar_integrator / qbar_FLPE)

Arrays stay on the valid-timestep grid, so write_output()'s re-insertion
of deleted timesteps and the strict-shape enforcement in compute_FLPs()
are both untouched.  Reaches with no genuine FLPE result (qbar_source is
'Prior') or a wrong-length series fall back to the flow-law hydrograph,
so coverage is unchanged.

Integrator_Hydrograph_Method='flowlaw' reproduces the previous output.
The FLP refit matched only nanmean(q) against qbar and nanquantile(q,.33)
against q33.  With 2-3 free parameters that is exactly- or
under-determined: the optimizer lands anywhere on the level set, so the
reported parameters are not identified even when the moments match.  On a
noise-free synthetic BAM reach the moment fit returns n=0.0449, A0=1125
for a truth of n=0.0310, A0=900.

Now that calc_integrator_hydrographs() produces the hydrograph first, the
refit has a full series to fit against, and flp_series_objfun does least
squares over it.  Same synthetic reach recovers n=0.0310, A0=900.0.  This
is the second half of 'fix the hydrograph, then get the FLPs correct'.

Linear space is kept deliberately, so the new objective is directly
comparable with the moment objective it replaces.

Reaches with no rescaled hydrograph (no genuine FLPE result) still use the
old moment objective, unchanged.

flp_fit_nrmse is written to every algorithm group: nRMSE of the refitted
flow law against the hydrograph that was actually exported, normalised by
its mean.  A fill value marks a reach that fell back to the flow-law
hydrograph.  MOMMA is expected to score worst -- Save is fixed, so B and H
are its only level controls and they are bounded by min(h); a noise-free
synthetic MOMMA reach converges to nRMSE 0.064 rather than to the true
(B,H).  The diagnostic is there to make that visible before we decide
whether to free nb, as momma's own constrain.momma.nb.x does.
Adds three-run mass conservation checks (script, notebook, and test),
an all-gage mean-fit exploration, and an OSC/Unity validation
comparison workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant