The refined beam centre / detector rotations were written from the
StartMessage at file open and then partially overwritten in Finalize -
but the overwrite updated beam_center_x/y and rot1/2/3 and NOT the
transformations/translation vector, which is what actually encodes the
beam centre in the NXmx geometry chain read by XDS/DIALS/dxtbx. The
reprocessed _process.h5 therefore had an internally inconsistent geometry
(refined rotations combined with the stale, unrefined beam centre).
The master file is never read before Finalize, so write the whole
refinable geometry (beam_center_x/y + translation + rot1/2/3) once there,
from the refined values when present and the StartMessage otherwise. This
drops the open-time write plus in-place overwrite and, unlike the old
path, keeps translation consistent with the refined beam centre.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>