diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index 6289bfda4..da5945c80 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -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(1, at_header.spots), + 100.0 * at_measured.on_lattice + / std::max(1, at_measured.spots), + 100.0 * at_header.by_chance / std::max(1, at_header.spots), + 100.0 * at_measured.by_chance + / std::max(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(1, at_measured.spots), - 100.0 * at_header.on_lattice - / std::max(1, at_header.spots), - 100.0 * at_measured.by_chance - / std::max(1, at_measured.spots), - 100.0 * at_header.by_chance - / std::max(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);