Focus-quality (HFD) indicator on the Focus screen#449
Open
brickbots wants to merge 2 commits into
Open
Conversation
Self-contained Half-Flux Diameter detector (PiFinder/focus.py) plus a focus strip in UIPreview: log-axis V-curve over a 10s window, best-focus marker, past-best "BACK UP" cue, and a background-anchored display stretch replacing per-frame autocontrast. The detector runs in the main process on the raw frame and does not depend on plate solving, so it works across the full defocus range. See docs/adr/0005-focus-hfd-self-contained-in-ui.md and the "Focus indicator" section of docs/ax/ui/CONTEXT.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reframe "Setting Focus & First Solve" around the HFD readout and its V-curve rather than zooming in to judge stars by eye. Add a focus-strip walkthrough and HUD example images (focused vs unfocused, with the strip composited over the existing example frames). 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.
What
Adds a quantitative, graphical focus aid to the Focus screen (
UIPreview). It tells the user how well-focused they are and makes the point of best focus obvious as they sweep through it — independent of plate solving, across the full defocus range.How
PiFinder/focus.py— pure, UI-free module: a self-contained Half-Flux Diameter (HFD) detector (detect_stars,half_flux_diameter,focus_hfd). Runs in the main process on the raw frame; tuned to accept broad/defocused blobs and reject hot pixels / oversized blobs. No dependency on the solver's centroids or SQM (see ADR 0005).UIPreview— a focus strip: fixed log-axis V-curve over a 10 s window, best-focus marker, past-best "BACK UP" cue, HFD/exposure/detected-count/matched-count HUD. Replaces per-frameautocontrastwith a background-anchored, EMA-smoothed display stretch. SQUARE toggles the strip; it persists across zoom (HFD is zoom-independent).python/tests/test_focus.py(11 unit tests: Gaussian HFD vs theory, saturated core, blank frame, oversized→too-defocused, monotonicity, median robustness, hot-pixel rejection).Design references already on
main:docs/adr/0005-focus-hfd-self-contained-in-ui.mdand the "Focus indicator" section ofdocs/ax/ui/CONTEXT.md.Verification
ruff/ruff format/mypyclean;pytest -m unit(190, incl. 11 new) and-m smoke(5) pass.—/det 0, SQUARE toggles the strip, zoom persists it with the relocatedZoom xNlabel, no crashes.Notes
_()-wrapped and fall back to English until the nextnox -s babel; the Babel catalog regeneration is intentionally not included (it swept up unrelated catalog drift).🤖 Generated with Claude Code