Files
Jungfraujoch/rugnux/RugnuxOutputFiles.h
T
leonarski_f 7ed32b899f
Build Packages / Create release (push) Successful in 7s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 4m53s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 9m27s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 15m0s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 20m4s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 21m33s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 22m4s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 25m16s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 26m14s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 27m26s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 30m26s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 22m20s
Build Packages / Generate python client (push) Successful in 32s
Build Packages / Build documentation (push) Successful in 1m20s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 23m28s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 26m23s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 20m35s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 25m59s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 26m27s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 22m15s
Build Packages / Unit tests (push) Successful in 1h26m38s
Build Packages / Validation Battery (push) Successful in 32m11s
v1.0.0-rc.177 (#87)
* jfjoch_broker: Faster live Rugnux analysis, with the GPU indexers prepared at the start of a collection and kept between collections; Rugnux no longer writes `.ccp4` maps (the map coefficients are in `<prefix>_maps.mtz`).

Reviewed-on: #87
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
2026-10-19 16:07:31 +02:00

58 lines
2.8 KiB
C++

// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <memory>
#include <string>
#include "Rugnux.h"
#include "ResultReport.h"
class FileWriter;
// The files of a run, written by the program that ran it - rugnux and the viewer - from what the analysis
// returned: the library itself writes none.
// <prefix><label>_process.h5: the per-image analysis of each output pass, as it is made
// (ProcessConfig::image_sink).
class ProcessFileSink : public RugnuxImageSink {
std::string prefix_;
std::unique_ptr<FileWriter> writer_;
public:
explicit ProcessFileSink(std::string prefix);
~ProcessFileSink() override;
void Start(const StartMessage &start, const std::string &label) override;
void Write(const DataMessage &msg) override;
void End(const EndMessage &end) override;
};
// Every file `result` holds, under `prefix` with the names rugnux gives them: the reflection files (.mtz,
// .cif, .hkl, the twin hypothesis' and the model's choice's), the unmerged observations, the maps and the
// placed models, _detector.jpg, _plot.txt, and the _process.h5 of a run that indexed nothing; the other
// cell's beside them where the doubled cell was merged too. `provenance` and `nthreads` are what the mmCIF
// is written with.
void WriteRugnuxOutputs(const ProcessResult &result, const std::string &prefix, const OutputProvenance &provenance,
size_t nthreads, Logger &logger);
// The reflection files of one merge at <prefix><suffix>: .mtz and .cif, and the .hkl where `hkl`.
void WriteMergedOutput(const MergedOutput &merged, const std::string &prefix, const OutputProvenance &provenance,
size_t nthreads, bool hkl);
// A model validation's map coefficients at `prefix`: _maps.mtz.
void WriteModelMaps(const ModelMaps &maps, const std::string &prefix, Logger &logger);
// <prefix>_plot.txt (PerImagePlotText).
void WritePerImagePlot(const std::string &prefix, const PerImagePlot &plot);
// Renders and writes <output_prefix>_report.txt, and returns the document it rendered (the CLI's
// closing summary reads it). Writes nothing when the prefix is empty (the "compute statistics,
// persist nothing" mode). Never throws: a run that produced good reflections must not be lost
// because a side file could not be written, so a failure is logged and swallowed.
ReportDocument WriteResultReport(const std::string &output_prefix,
const std::string &input_file,
const DiffractionExperiment &experiment,
const ProcessResult &result,
Logger &logger,
const RunProvenance &provenance = {});