diff --git a/image_analysis/IndexAndRefine.cpp b/image_analysis/IndexAndRefine.cpp index f56aa0b26..8d899bec1 100644 --- a/image_analysis/IndexAndRefine.cpp +++ b/image_analysis/IndexAndRefine.cpp @@ -983,11 +983,16 @@ std::optional IndexAndRefine::GetConsensusUnitCell() const { return result->lattice.GetUnitCell(); } + // The cell of the frames that are merged: where the per-image outcomes are kept, a frame the merge + // has left out (its reflections cleared, e.g. by the given-cell population filter) does not count. std::vector cells; { std::unique_lock ul(reflections_mutex); cells.reserve(unit_cells.size()); - for (const auto &cell: unit_cells) { + for (size_t i = 0; i < unit_cells.size(); i++) { + const auto &cell = unit_cells[i]; + if (retain_outcomes_ && integration_outcome[i].reflections.empty()) + continue; if (cell && cell->is_finite()) cells.emplace_back(*cell); } diff --git a/rugnux/RugnuxScaleMerge.cpp b/rugnux/RugnuxScaleMerge.cpp index b4d19bc2b..815b0edec 100644 --- a/rugnux/RugnuxScaleMerge.cpp +++ b/rugnux/RugnuxScaleMerge.cpp @@ -537,10 +537,14 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) { (r < low ? below : above)++; } } - if (below + above > 0) + if (below + above > 0) { logger.Info("Given cell: {} of {} indexed frames refined to a cell outside its population " "({:+.1f}% to {:+.1f}% in volume) and are left out of the merge - {} smaller, {} larger", below + above, rel.size(), 100 * low, 100 * high, below, above); + // The cell written is the mean over the frames merged, not over the other form's as well. + result.consensus_cell = indexer->GetConsensusUnitCell(); + end_msg.unit_cell = result.consensus_cell; + } } size_t ice_flagged = 0, ice_total = 0; {