// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include "gemmi/model.hpp" #include "../common/JFJochMessages.h" class Logger; // The files rugnux writes beside its merged output, made from the structured END-message blocks // (common/JFJochMessages.h), so that jfjoch_writer can write them with no analysis library. rugnux // writes its own MTZ files through the same function. // An MTZ file from its table. Throws where the table does not describe one: a column with another number // of rows than the first, a column or a batch naming a dataset the table does not have, a batch header that // is not 29 + 156 long, or a space group gemmi does not know. void WriteMtz(const MtzTable &table, const std::string &filename); // The model the block describes, for WritePlacedModel (writer/WriteModel.h). Throws where the block // describes none: a per-atom field with another number of entries than atom_name, or aniso neither empty // nor six per atom. gemmi::Structure PlacedModelStructure(const PlacedModelMessage &model); // The three files above, from whichever blocks `end` carries, at .mtz, _maps.mtz and // _model.cif (WritePlacedModel adds _model.pdb where a PDB can hold the cell). Each is written under a // temporary name and renamed into place. An existing file is replaced only with `overwrite`; otherwise // it is kept and the new one is not written. void WriteRugnuxResultFiles(const EndMessage &end, const std::string &file_prefix, bool overwrite, Logger &logger);