raster_highest_score now falls back to the geometric grid centre when the
grid is too weak to contain a crystal, instead of collecting at the noisy argmax
cell. So a "nothing in the loop" result is centred and deliberate rather than
data collected on noise.
Guard (grid-wide, OR rule): route to centre when the grid-wide maximum
spots_low_res is below min_low_res_spotsor the grid-wide maximum
spots_indexed is below min_spots_indexed (defaults 10.0 and 1, exposed as
tunable parameters).
Returns a CenterOfMassModel at the centre (not None), so both DAQ call sites
work unchanged — the simulated branch (no None check) and the real branch (its
existing None-fallback simply stays dead). No AareDAQ change required.
Single file touched: src/aarecommon/math/find_xtal.py.
Test
uv run python src/aarecommon/math/find_xtal.py prints find_xtal self-check passed
(crystal maps to best cell; all-noise maps to centre; strong-spots-but-unindexed
maps to centre via the OR rule).
Open question (why WIP)
With OR plus min_spots_indexed=1, a grid where nothing indexed anywhere
routes to centre even with strong low-res spots. If that is too aggressive for
crystals that diffract but fail to index, flip the guard to AND (one line).
Generated with Claude Code.
**WIP — not ready to merge.**
Closes #10.
## What
`raster_highest_score` now falls back to the geometric **grid centre** when the
grid is too weak to contain a crystal, instead of collecting at the noisy argmax
cell. So a "nothing in the loop" result is centred and deliberate rather than
data collected on noise.
Guard (grid-wide, **OR** rule): route to centre when the grid-wide maximum
spots_low_res is below `min_low_res_spots` **or** the grid-wide maximum
spots_indexed is below `min_spots_indexed` (defaults `10.0` and `1`, exposed as
tunable parameters).
Returns a `CenterOfMassModel` at the centre (not None), so both DAQ call sites
work unchanged — the simulated branch (no None check) and the real branch (its
existing None-fallback simply stays dead). No AareDAQ change required.
Single file touched: `src/aarecommon/math/find_xtal.py`.
## Test
`uv run python src/aarecommon/math/find_xtal.py` prints `find_xtal self-check passed`
(crystal maps to best cell; all-noise maps to centre; strong-spots-but-unindexed
maps to centre via the OR rule).
## Open question (why WIP)
With OR plus `min_spots_indexed=1`, a grid where **nothing indexed anywhere**
routes to centre even with strong low-res spots. If that is too aggressive for
crystals that diffract but fail to index, flip the guard to AND (one line).
Generated with Claude Code.
raster_highest_score always returns the argmax cell, which lands on
noise when the loop has no crystal. Add a grid-wide weakness guard:
when max(spots_low_res) < min_low_res_spots OR max(spots_indexed) <
min_spots_indexed, return a CenterOfMassModel at the geometric grid
centre instead of collecting at a noisy cell. Thresholds are tunable
parameters (defaults 10.0 and 1).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
WIP — not ready to merge.
Closes #10.
What
raster_highest_scorenow falls back to the geometric grid centre when thegrid is too weak to contain a crystal, instead of collecting at the noisy argmax
cell. So a "nothing in the loop" result is centred and deliberate rather than
data collected on noise.
Guard (grid-wide, OR rule): route to centre when the grid-wide maximum
spots_low_res is below
min_low_res_spotsor the grid-wide maximumspots_indexed is below
min_spots_indexed(defaults10.0and1, exposed astunable parameters).
Returns a
CenterOfMassModelat the centre (not None), so both DAQ call siteswork unchanged — the simulated branch (no None check) and the real branch (its
existing None-fallback simply stays dead). No AareDAQ change required.
Single file touched:
src/aarecommon/math/find_xtal.py.Test
uv run python src/aarecommon/math/find_xtal.pyprintsfind_xtal self-check passed(crystal maps to best cell; all-noise maps to centre; strong-spots-but-unindexed
maps to centre via the OR rule).
Open question (why WIP)
With OR plus
min_spots_indexed=1, a grid where nothing indexed anywhereroutes to centre even with strong low-res spots. If that is too aggressive for
crystals that diffract but fail to index, flip the guard to AND (one line).
Generated with Claude Code.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.