beam centre: the depth question is asked at both centres

The ladder inside the beam-centre check ran only at the MEASURED centre, and
its count was then set against the whole spot list at the file's. Two things
differ between those two numbers - where the beam is and how much of each frame
the pass reads - so the count cannot say which of them the gain came from, and
the run attributed all of it to the centre.

Measured on one crystal: at the measured centre, 15 px and 2.8 sigma from the
file's, the ladder reached 40/60 on a cell five times the deposited primitive
volume; at the file's own centre it reaches 49/60 on the deposited cell. The
run moved the centre, post-refined the supercell, and - standing at 40/60 -
skipped the beam-centre walk that finds the crystal's own centre six pixels the
other way. It shipped a C-centred monoclinic cell of the right volume in the
wrong lattice, on 43 per cent of the unique reflections.

The ladder now runs at both centres and the centre moves only when it is the
centre that pays. An exact tie keeps the file's centre. Where the file's centre
wins, the run takes that rung and says the depth, not the centre, was the
problem.

No arbiter can be asked instead here: at the measured centre the true cell is
not among the rungs, so no rung-versus-rung comparison contains the right
answer, and the standing pass the winner would be judged against is itself a
wrong 18 thousand cubic Angstrom cell 32 times smaller.
This commit is contained in:
leonarski_f committed 2026-09-13 07:36:48 +02:00
1 parent a751aec32c
commit 591c8cbc4b
1 file changed
+35 -3
+35 -3
View File
@@ -3334,10 +3334,42 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
// the run died; with the ladder's lean seed the measured centre indexes 60/60, and
// the run then indexes every frame of the sweep and merges to the deposited
// resolution. So ask the ladder here too, before giving the centre up.
//
// The depth is asked at BOTH centres, and the centre moves only if it is the
// centre that paid. A lean rung at the measured centre scored against the whole
// spot list at the file's changes two things at once, and the count cannot say
// which of them the gain came from - the same reason a trial centre is scored on
// its own spots at all. Measured on one crystal: the measured centre's ladder
// reached 40/60 on a FIVE-fold axis harmonic while the file's own centre reached
// 49/60 on the deposited cell, and the run moved the centre, shipped the
// supercell, and skipped the beam-centre walk that would have found the crystal's
// own. An exact tie keeps the file's centre: nothing then says the centre is wrong.
bool lean = false;
bool deeper_at_home = false;
if (!measured_indexes) {
if (auto l = first_pass_ladder(alt.score, 1, majority + 1)) {
alt = *l;
const FirstPassState before = committed;
restore_beam_center(header_x, header_y);
const auto home = first_pass_ladder(best.score, 1, majority + 1);
const FirstPassState home_state = committed;
committed = before;
apply_state(committed);
try_beam_center(measured_x, measured_y);
const auto away = first_pass_ladder(alt.score, 1, majority + 1);
if (home && (!away || home->score >= away->score)) {
committed = home_state;
restore_beam_center(header_x, header_y);
apply_state(committed);
best = *home;
deeper_at_home = true;
logger.Warning("Beam centre check: reading less of each frame takes the "
"file's centre to {}/{} validation frames against {}/{} at "
"the measured centre {:.2f} px away - it is how deep this "
"run was reading and not the centre, so the centre stays",
home->score, static_cast<int>(validation.size()),
away ? away->score : 0,
static_cast<int>(validation.size()), moved);
} else if (away) {
alt = *away;
measured_indexes = true;
lean = true;
}
@@ -3361,7 +3393,7 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
static_cast<int>(validation.size()), measured_x, measured_y,
alt.score, static_cast<int>(validation.size()));
best = alt;
} else {
} else if (!deeper_at_home) {
// Nothing worked. Put the file's centre back, so the ladder below searches
// around the value the run started with rather than around a fit that has just
// been tested and found no better - and so a run that fails for some other