diff --git a/rugnux/RugnuxPreScan.cpp b/rugnux/RugnuxPreScan.cpp index f11216aaf..d56ffb537 100644 --- a/rugnux/RugnuxPreScan.cpp +++ b/rugnux/RugnuxPreScan.cpp @@ -1209,7 +1209,9 @@ void Rugnux::PreScan(int start_image, int images_to_process, int frame_count, Ru if (want_shadow && config_.beam_center_check) background_center_capture_ = std::async(std::launch::async, [x = experiment_, mask = centre_mask, projection, - nthreads = config_.nthreads] { + nthreads = config_.nthreads, + ahead = mappings_ahead_, + cache = azint_geometry_] { Logger logger("Rugnux"); const auto t0 = std::chrono::steady_clock::now(); BeamCenterFFTResult capture; @@ -1217,6 +1219,13 @@ void Rugnux::PreScan(int start_image, int images_to_process, int frame_count, Ru FindBeamCenter(x, mask, *projection, nthreads, &capture); const auto capture_ms = std::chrono::duration_cast( std::chrono::steady_clock::now() - t0).count(); + // The first pass's beam-centre check indexes at this centre too (TryBeamCenter): its mapping is + // built from here. + if (background_center) { + DiffractionExperiment at_centre = x; + at_centre.BeamX_pxl(background_center->beam_x_pxl).BeamY_pxl(background_center->beam_y_pxl); + ahead->Build(std::move(at_centre), mask, cache, nthreads); + } const auto [direct_x, direct_y] = x.GetDiffractionGeometry().GetDirectBeam_pxl(); if (!capture.point.empty()) logger.Info("Beam centre capture: the strongest point-symmetry centre on the WHOLE "