// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #include "ScalingResult.h" #include #include #include "../../common/JFJochException.h" ScalingResult::ScalingResult(size_t n) : image_scale_g(n, NAN), mosaicity_deg(n, NAN), image_bfactor_Ang2(n, NAN), rotation_wedge_deg(n, NAN), image_cc(n, NAN), image_cc_n(n, 0) {} void ScalingResult::SaveToFile(const std::string &filename) { const std::string img_path = filename + "_image.dat"; std::ofstream img_file(img_path, std::ofstream::out | std::ofstream::trunc); if (!img_file) { throw JFJochException(JFJochExceptionCategory::FileWriteError , "Cannot open {} for writing"); } for (size_t i = 0; i < image_scale_g.size(); ++i) { img_file << i << " " << image_scale_g[i] << " " << image_bfactor_Ang2[i] << " " << mosaicity_deg[i] << " " << rotation_wedge_deg[i] << " " << image_cc[i] << " " << image_cc_n[i] << "\n"; } img_file.close(); }