Refresh Definitions help for students; fix bad-line + stale-UI text#41
Merged
Merged
Conversation
The in-app Definitions/Help reference had drifted from the code and read as a spec rather than a getting-started guide. This makes it accurate and more student-friendly. - Bad-line correction (entry + how-to): rewrite for the current MAD method — the residual is smoothed along the row (matched filter, ~11 px), thresholded directly against MADN of the smoothed residual (no per-row median), with noise- gap bridging, a median significance guard, and no upper length cap; the repair adjacent-line limit is now column-aware (only vertically overlapping stacks count). Reframed from "short streaks only" to short scars (step) and long faint lines (mad). Kept the test-pinned "S = [j0, j1)" notation. - Stale UI references: "ROI tab" -> "ROI/Mask tab" (tabs merged); FFT how-to "Expert tab" -> the Correction tab (Expert tab removed), with a note to match the target lattice to the Bragg/known-structure spacing. - Student-usability pass: add a beginner "In practice:" lead (new optional _DefinitionEntry.in_practice field, rendered before the equations with a .lead style) to all 17 processing and 7 ROI entries, so a newcomer gets concrete "when to use / what to set" guidance and can skip the math. Clarified the Gaussian-smoothing note (sigma is the Gaussian width / standard deviation; kernel reaches ~±4 sigma) to match the viewer's new readout. Verified: physics-check of the bad-line equations vs bad_lines.py (no issues), test_definitions_dialog.py and test_viewer_window_menu.py green, ruff clean. Co-Authored-By: Claude Opus 4.8 <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.
What
Makes the in-app Definitions / Help reference accurate and easier for students to start from.
Accuracy (the must-fix)
MADNof the smoothed residual (no per-row median), with noise-gap bridging, a median significance guard, and no upper length cap. The repair's adjacent-line limit is now column-aware (only vertically overlapping stacks count). Reframed from "short streaks only" → short scars (step) vs long faint lines (mad).ROI tab→ROI/Mask tab(tabs merged); FFT how-toExpert tab→ Correction tab (Expert removed), plus a reminder to match the target lattice to the Bragg/known-structure spacing.Student usability
_DefinitionEntry.in_practicefield renders a beginner "In practice:" lead before the equations (with a.leadstyle), added to all 17 processing + 7 ROI entries — concrete "when to use / what to set" so newcomers can skip the math.Verification
physics-checkof the bad-line equations vsbad_lines.py— no issues; equations match the implementation line-by-line.test_definitions_dialog.py+test_viewer_window_menu.pygreen;ruffclean. Test-pinned strings (S = [j0, j1), etc.) preserved.🤖 Generated with Claude Code