b53f0d6474
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 14m10s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m51s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 15m28s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 15m49s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m8s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 16m40s
Build Packages / build:rpm (rocky8) (push) Successful in 11m55s
Build Packages / XDS test (durin plugin) (push) Successful in 10m54s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 12m7s
Build Packages / build:rpm (rocky9) (push) Successful in 13m36s
Build Packages / Generate python client (push) Successful in 26s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m31s
Build Packages / Build documentation (push) Successful in 1m7s
Build Packages / DIALS test (push) Successful in 14m53s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 7m6s
Build Packages / XDS test (neggia plugin) (push) Successful in 6m9s
Build Packages / Unit tests (push) Successful in 58m34s
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include "ScalingResult.h"
|
|
#include <cmath>
|
|
#include <fstream>
|
|
|
|
#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) {
|
|
}
|
|
|
|
void ScalingResult::SaveToFile(const std::string &filename) {
|
|
const std::string img_path = filename + "_image.dat";
|
|
std::ofstream img_file(img_path);
|
|
if (!img_file) {
|
|
throw JFJochException(JFJochExceptionCategory::FileWriteError
|
|
, "Cannot open {} for writing");
|
|
}
|
|
|
|
img_file << "# image_id G B mosaicity_deg wedge_deg\n";
|
|
|
|
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]
|
|
<< "\n";
|
|
}
|
|
|
|
img_file.close();
|
|
}
|
|
|