From f396385e119081ae6f35d03fc923d98f1f9653f4 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sat, 18 Jul 2026 12:19:16 +0200 Subject: [PATCH] rugnux: record the detector distance and beam centre in the merged mmCIF Add _diffrn_detector.jfjoch_{distance_mm,beam_center_x_pxl,beam_center_y_pxl} to the merged mmCIF header, as feedback of the geometry the data was actually reduced with. When geometry refinement ran (the rotation two-pass or the stills global refinement, which update experiment_ before the written pass) these are the refined values; otherwise they are the nominal header geometry. Co-Authored-By: Claude Opus 4.8 (1M context) --- image_analysis/WriteReflections.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/image_analysis/WriteReflections.cpp b/image_analysis/WriteReflections.cpp index e385f426..80017e97 100644 --- a/image_analysis/WriteReflections.cpp +++ b/image_analysis/WriteReflections.cpp @@ -118,6 +118,12 @@ void WriteMmcifReflections(const std::vector &reflections, out << "_diffrn_radiation_wavelength.wavelength " << Fmt(experiment.GetWavelength_A(), 5) << "\n"; out << "_diffrn_detector.detector " << CifStr(experiment.GetDetectorDescription()) << "\n"; + // Detector geometry actually used for integration (refined, when geometry refinement ran - the rotation + // two-pass or the stills global refinement update it on experiment_ before the written pass). jfjoch_ + // local-data-name items: feedback of the distance / beam centre the data was reduced with. + out << "_diffrn_detector.jfjoch_distance_mm " << Fmt(experiment.GetDetectorDistance_mm(), 4) << "\n"; + out << "_diffrn_detector.jfjoch_beam_center_x_pxl " << Fmt(experiment.GetBeamX_pxl(), 2) << "\n"; + out << "_diffrn_detector.jfjoch_beam_center_y_pxl " << Fmt(experiment.GetBeamY_pxl(), 2) << "\n"; out << "#\n"; // ---------- merging statistics (_reflns overall + _reflns_shell loop) ----------