fix(lmc): fill in-domain NaN precip gaps so corrupt AORC days do not …#12
Merged
Merged
Conversation
…empty the domain The AORC mirror has NaN patches on isolated storm days (e.g. 1985-11-07, 2003-10-19, 2024-06-18). 3.LMC.py sums raw precip over the whole basin polygon and requires every year's annual-max window to be finite, so one corrupt cell NaNs the L-moment of every anchor whose footprint covers it. Over the full ~45yr record this collapsed the L-moment field from 2675 cells to 47, so CLMPV could not grow a transposition domain (a clean 5yr window hid the problem). run_lmc now fills in-domain NaN precip cells with 0 before LMC. Off-domain cells (NaN in every file) are left untouched, so the valid-anchor set is unchanged; each cell's spatial L-moment averages over all years, so one 0-filled bad day is negligible. Verified in-container: LMCol chunk 0 finite cells 11 -> 424. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
…empty the domain
The AORC mirror has NaN patches on isolated storm days (e.g. 1985-11-07, 2003-10-19, 2024-06-18). 3.LMC.py sums raw precip over the whole basin polygon and requires every year's annual-max window to be finite, so one corrupt cell NaNs the L-moment of every anchor whose footprint covers it. Over the full ~45yr record this collapsed the L-moment field from 2675 cells to 47, so CLMPV could not grow a transposition domain (a clean 5yr window hid the problem).
run_lmc now fills in-domain NaN precip cells with 0 before LMC. Off-domain cells (NaN in every file) are left untouched, so the valid-anchor set is unchanged; each cell's spatial L-moment averages over all years, so one 0-filled bad day is negligible. Verified in-container: LMCol chunk 0 finite cells 11 -> 424.