From fcafc61be622e0965d4bdf9dd0c2a5bb82d49a9e Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 18 Jul 2026 22:21:07 +0200 Subject: [PATCH] rugnux: two-pass refined pass takes the canonical (unsuffixed) output name In the rotation two-pass geometry post-refine, the second (refined-geometry) pass is the result users want, so give it the plain _* name and keep the first (header-geometry) pass as _01_*. Previously the refined pass was _02_*, leaving no plain _* output; a downstream consumer that expects the canonical name now finds the refined result there. Co-Authored-By: Claude Opus 4.8 (1M context) --- rugnux/Rugnux.cpp | 11 +++++------ rugnux/rugnux_cli.cpp | 2 +- viewer/windows/JFJochProcessingJobsWindow.cpp | 9 +++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index 826ba950..8c30afd0 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -220,9 +220,9 @@ ProcessResult Rugnux::Run(RugnuxObserver *observer) { // Rotation two-pass geometry post-refinement: the first pass integrates at the header geometry and // post-refines the detector geometry (distance + beam from the observed spot positions, cell scale + axis // from phi_obs); the second pass re-indexes and re-integrates with the refined geometry. BOTH passes are - // written out - "_01_*" is the first (header-geometry) pass and "_02_*" the second (refined - // geometry) - so the two can be compared and the better one kept, and the ice-ring flags / geometry stored - // in each master reflect the geometry that pass actually used. + // written out - the second (refined-geometry) pass is the CANONICAL result and takes the plain "_*" + // name, while the first (header-geometry) pass is kept as "_01_*" for comparison - so the two can be + // compared and the ice-ring flags / geometry stored in each master reflect the geometry that pass used. if (config_.mode == ProcessMode::FullAnalysis && config_.rotation_postrefine_geometry && experiment_.IsRotationIndexing()) { Logger logger("Rugnux"); @@ -253,11 +253,10 @@ ProcessResult Rugnux::Run(RugnuxObserver *observer) { experiment_.SpaceGroupNumber(std::nullopt); prepass_merge_sg_ = prepass_sg_reindexed_ ? std::nullopt : pass1.space_group_number; - logger.Info("Rotation two-pass geometry post-refinement: second pass (refined geometry) -> {}_02_*", + logger.Info("Rotation two-pass geometry post-refinement: second pass (refined geometry, canonical) -> {}_*", base_prefix); - config_.output_prefix = base_prefix + "_02"; + config_.output_prefix = base_prefix; // the refined pass is the canonical result (no _02 suffix) auto pass2 = RunPipeline(observer, /*write_output=*/true, /*geometry_prepass=*/false); - config_.output_prefix = base_prefix; return pass2; } return RunPipeline(observer, /*write_output=*/true, /*geometry_prepass=*/false); diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index 73354663..76dc654a 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -77,7 +77,7 @@ void print_usage() { std::cout << " --single-pass-rotation[=num] Use online-like single-pass rotation indexing (optional: min angular range deg)" << std::endl; std::cout << " --redo-rotation-spots Redo spot finding for two-pass rotation indexing" << std::endl; std::cout << " --force-rotation-lattice Force rotation indexer with external lattice (in Angstrom) : \"a0x,a0y,a0z,a1x,a1y,a1z,a2x,a2y,a2z\" (9 floats, skips first pass)" << std::endl; - std::cout << " --rotation-no-postrefine Disable the (default-on) two-pass rotation post-refine (post-refine detector distance/beam + cell/axis, then re-integrate; writes both passes _01 header geometry, _02 refined)" << std::endl; + std::cout << " --rotation-no-postrefine Disable the (default-on) two-pass rotation post-refine (post-refine detector distance/beam + cell/axis, then re-integrate; the refined pass is the canonical _* output, the header-geometry pass is kept as _01_*)" << std::endl; std::cout << " -X, --indexing-algorithm Indexing algorithm (FFBIDX|FFT|FFTW|Auto|None)" << std::endl; std::cout << " -S, --space-group Space group number (92) or symbol (P43212) - for indexing and scaling" << std::endl; std::cout << " -C, --unit-cell Fix reference unit cell: \"a,b,c,alpha,beta,gamma\"" << std::endl; diff --git a/viewer/windows/JFJochProcessingJobsWindow.cpp b/viewer/windows/JFJochProcessingJobsWindow.cpp index 45462d0f..94585a2f 100644 --- a/viewer/windows/JFJochProcessingJobsWindow.cpp +++ b/viewer/windows/JFJochProcessingJobsWindow.cpp @@ -211,16 +211,17 @@ int JFJochProcessingJobsWindow::askJob(const ReprocessingInputs &inputs, JobSpec refineRowLayout->addStretch(); // Rotation two-pass geometry post-refine: a first pass post-refines the detector distance / beam / - // cell + rotation axis from the whole sweep, then re-integrates at that geometry (writing both passes, - // _01 header geometry and _02 refined). Rotation-only; default on there, to match the rugnux CLI. + // cell + rotation axis from the whole sweep, then re-integrates at that geometry (the refined pass is the + // canonical _* output, the header-geometry pass is kept as _01_*). Rotation-only; + // default on there, to match the rugnux CLI. const bool rotation_run = !azint && inputs.experiment.GetIndexingSettings().GetRotationIndexing(); auto *postrefine = new QCheckBox("Post-refine geometry (rotation, two-pass)", &dlg); postrefine->setChecked(rotation_run); postrefine->setEnabled(rotation_run); postrefine->setToolTip( "Rotation only: a first pass post-refines the detector distance / beam centre / cell / rotation " - "axis from the whole sweep, then re-integrates at the refined geometry. Writes both passes " - "(_01 header geometry, _02 refined). Default on; a no-op for stills."); + "axis from the whole sweep, then re-integrates at the refined geometry. The refined pass is the " + "canonical output; the header-geometry pass is kept as _01. Default on; a no-op for stills."); auto *form = new QFormLayout; form->addRow("Start image", start_image);