jfjoch_process: Write amplitudes at the end into hkl file in addition to mmCIF file (to be improved later)

This commit is contained in:
2026-02-17 13:08:59 +01:00
parent c4d4b5d570
commit f3e8379a55
+21 -18
View File
@@ -179,6 +179,7 @@ int main(int argc, char **argv) {
experiment.Mode(DetectorMode::Standard); // Ensure full image analysis
experiment.PixelSigned(true);
experiment.OverwriteExistingFiles(true);
experiment.PolarizationFactor(0.99); // Unpolarized beam
// Configure Indexing
IndexingSettings indexing_settings;
@@ -446,21 +447,7 @@ int main(int argc, char **argv) {
scale_time, scale_result->gof2,
scale_result->merged.size(), scale_result->image_ids.size());
// Write scaled.hkl (h k l I sigma)
{
const std::string hkl_path = output_prefix + "_scaled.hkl";
std::ofstream hkl_file(hkl_path);
if (!hkl_file) {
logger.Error("Cannot open {} for writing", hkl_path);
} else {
for (const auto &r: scale_result->merged) {
hkl_file << r.h << " " << r.k << " " << r.l << " "
<< r.I << " " << r.sigma << "\n";
}
hkl_file.close();
logger.Info("Wrote {} reflections to {}", scale_result->merged.size(), hkl_path);
}
}
// Write image.dat (image_id mosaicity_deg K)
{
@@ -486,13 +473,29 @@ int main(int argc, char **argv) {
fw_opts.acentric = true; // typical for MX
fw_opts.num_shells = 20;
auto fw = FrenchWilson(scale_result->merged, fw_opts); {
auto fw = FrenchWilson(scale_result->merged, fw_opts);
{
{
// Write scaled.hkl (h k l I sigma)
const std::string hkl_path = output_prefix + "_amplitudes.hkl";
std::ofstream hkl_file(hkl_path);
if (!hkl_file) {
logger.Error("Cannot open {} for writing", hkl_path);
} else {
for (const auto &r: fw) {
hkl_file << r.h << " " << r.k << " " << r.l << " "
<< r.F << " " << r.sigmaF << " "
<< r.I << " " << r.sigmaI
<< "\n";
}
hkl_file.close();
logger.Info("Wrote {} reflections to {}", scale_result->merged.size(), hkl_path);
}
}
MmcifMetadata cif_meta;
// Unit cell — from rotation indexing result or experiment setting
if (rotation_indexer_ret.has_value()) {
logger.Info("Bla {:f} {:f}", rotation_indexer_ret->lattice.GetUnitCell().a,
rotation_indexer_ret->lattice.GetUnitCell().b);
cif_meta.unit_cell = rotation_indexer_ret->lattice.GetUnitCell();
} else if (experiment.GetUnitCell().has_value()) {
cif_meta.unit_cell = experiment.GetUnitCell().value();