Beam centre check: decide a harmonic DISAGREE in both directions
Where the file's and the measured beam centre index lattices whose primitive volumes differ by an integer factor 2-4, the pooled validation evidence decided only when the measured centre held the LARGER cell. The other direction was left to the second pass on the assumption that it drops to the smaller cell by itself. It does so only when the pass-2 indexer's free beam refinement walks the whole centre error, and that rescue is chaotic: on 7ris a 0.1 % change in the pass-1 distance switched off a 6.5 px walk, the doubled c axis (380 A) won and the run failed. Both directions are now decided on the same measurement: pooled validation spots on each lattice against its own wrong-spindle null (ValidationEvidencePrefers). No new threshold. 7ris: 44.3 % at the file's centre vs 83.5 % at the measured one; the run adopts the measured centre and the 190 A cell (R_free 0.81 -> 0.20, 1.52 A). 8pqd (3x, measured centre holds the true cell): 16.6 % vs 21.0 %, adopted in pass 1 instead of being recovered by pass 2. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D1G8gJVAy6gp1K5Dz3NE5C
This commit is contained in:
1 parent
6dcef006bb
commit
040810aa3d
1 file changed
+27
-27
+27
-27
@@ -4357,44 +4357,44 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b
|
||||
// Deliberately no decision on the frame counts. They are the one statistic
|
||||
// that must not choose: on the measured case the harmonic indexed MORE.
|
||||
//
|
||||
// One direction is decided, and only one: where the MEASURED centre holds
|
||||
// the LARGER of an integer-related pair. That is the case nothing else in
|
||||
// the run repairs - the frame count leans to the sub-cell, and the second
|
||||
// pass refuses a lattice larger than pass 1's (the supercell guard below),
|
||||
// so a run that starts on the sub-cell stays on it. The opposite direction
|
||||
// needs no help here: the second pass is free to drop to the smaller cell
|
||||
// and does, on every corpus crystal that reaches this branch that way.
|
||||
// Decided in either direction on the pooled excess over chance, the same
|
||||
// measurement the failed-pass branch above adopts a centre on. Each lattice is
|
||||
// scored against its own wrong-spindle null, so the larger cell is not credited
|
||||
// for the spots a denser lattice catches by accident, and the smaller one is
|
||||
// not credited for the spots it misses.
|
||||
//
|
||||
// Decided on the pooled excess over chance, the same measurement the
|
||||
// failed-pass branch above adopts a centre on. Each lattice is scored
|
||||
// against its own wrong-spindle null, so the larger cell is not credited
|
||||
// for the spots a denser lattice catches by accident.
|
||||
// Both directions need it. Where the measured centre holds the LARGER cell,
|
||||
// nothing else in the run repairs it - the second pass refuses a lattice larger
|
||||
// than pass 1's (the supercell guard below). Where it holds the SMALLER one,
|
||||
// the second pass can drop to it only if its own beam refinement happens to
|
||||
// walk the whole centre error, and that rescue is chaotic: measured on one
|
||||
// crystal, a 0.1 % change in the pass-1 distance switched off a 6.5 px walk and
|
||||
// the run kept the doubled axis.
|
||||
const double nearest_n = std::round(ratio);
|
||||
const bool integer_harmonic = nearest_n >= 2.0 && nearest_n <= 4.0
|
||||
&& std::abs(ratio - nearest_n) < 0.15;
|
||||
bool adopted_measured = false;
|
||||
if (integer_harmonic && alt.vol > best.vol) {
|
||||
if (integer_harmonic) {
|
||||
const PooledEvidence at_header = pooled_evidence(*indexer, *best.result);
|
||||
try_beam_center(measured_x, measured_y);
|
||||
const PooledEvidence at_measured = pooled_evidence(*indexer, *alt.result);
|
||||
adopted_measured = beats_chance(at_measured)
|
||||
&& ValidationEvidencePrefers(at_header, at_measured);
|
||||
logger.Info("Beam centre check: pooled validation spots on the lattice "
|
||||
"{:.1f}% at the file's centre and {:.1f}% at the measured "
|
||||
"(chance {:.1f}% and {:.1f}%)",
|
||||
100.0 * at_header.on_lattice / std::max<int64_t>(1, at_header.spots),
|
||||
100.0 * at_measured.on_lattice
|
||||
/ std::max<int64_t>(1, at_measured.spots),
|
||||
100.0 * at_header.by_chance / std::max<int64_t>(1, at_header.spots),
|
||||
100.0 * at_measured.by_chance
|
||||
/ std::max<int64_t>(1, at_measured.spots));
|
||||
if (adopted_measured) {
|
||||
logger.Warning("Beam centre check: the larger cell is the measured "
|
||||
"centre's, and it is the one the spots are on - "
|
||||
"{:.1f}% of the pooled validation spots lie on it "
|
||||
"against {:.1f}% on the file's cell (chance {:.1f}% "
|
||||
"and {:.1f}%) - so the {:.2f}x is a real axis and not "
|
||||
"a harmonic, and the run adopts the measured centre",
|
||||
100.0 * at_measured.on_lattice
|
||||
/ std::max<int64_t>(1, at_measured.spots),
|
||||
100.0 * at_header.on_lattice
|
||||
/ std::max<int64_t>(1, at_header.spots),
|
||||
100.0 * at_measured.by_chance
|
||||
/ std::max<int64_t>(1, at_measured.spots),
|
||||
100.0 * at_header.by_chance
|
||||
/ std::max<int64_t>(1, at_header.spots),
|
||||
ratio);
|
||||
logger.Warning("Beam centre check: the spots are on the {} cell of the "
|
||||
"measured centre, not on the file's - so the {:.2f}x is "
|
||||
"the file's centre error and not the crystal, and the "
|
||||
"run adopts the measured centre",
|
||||
alt.vol > best.vol ? "larger" : "smaller", ratio);
|
||||
best = alt;
|
||||
} else {
|
||||
restore_beam_center(header_x, header_y);
|
||||
|
||||
Reference in new issue
Block a user