Add gage-constrained correlated SFOI integration - #67
Open
RaidoYAGAMI wants to merge 10 commits into
Open
Conversation
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.
RaidoYAGAMI
force-pushed
the
gage-correlation
branch
from
August 25, 2026 19:58
37cfbf1 to
77c304d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.