UpdateReflectionResolution: Separate file + clear bug
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m35s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 15m45s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 15m51s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m9s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 16m10s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 17m16s
Build Packages / build:rpm (rocky8) (push) Successful in 14m52s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m54s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 12m57s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (ubuntu2404) (push) Successful in 14m27s
Build Packages / XDS test (durin plugin) (push) Successful in 13m17s
Build Packages / Build documentation (push) Successful in 54s
Build Packages / build:rpm (rocky9) (push) Successful in 15m42s
Build Packages / DIALS test (push) Successful in 16m54s
Build Packages / XDS test (neggia plugin) (push) Successful in 5m44s
Build Packages / Unit tests (push) Successful in 59m15s

This commit is contained in:
2026-05-17 17:11:45 +02:00
parent f5447b3478
commit 39fef1bcef
7 changed files with 37 additions and 22 deletions
+3 -1
View File
@@ -32,7 +32,9 @@ ADD_LIBRARY(JFJochImageAnalysis STATIC
WriteMmcif.cpp
WriteMmcif.h
LoadFCalcFromMtz.cpp
LoadFCalcFromMtz.h)
LoadFCalcFromMtz.h
UpdateReflectionResolution.cpp
UpdateReflectionResolution.h)
FIND_PACKAGE(Eigen3 3.4 REQUIRED NO_MODULE) # provides Eigen3::Eigen
@@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include "UpdateReflectionResolution.h"
#include "../common/CrystalLattice.h"
void UpdateReflectionResolution(const UnitCell &cell, std::vector<std::vector<Reflection> > &reflections) {
CrystalLattice latt(cell);
const auto astar = latt.Astar();
const auto bstar = latt.Bstar();
const auto cstar = latt.Cstar();
for (auto &image: reflections) {
for (auto &r: image) {
Coord q = r.h * astar + r.k * bstar + r.l * cstar;
auto qlen = q.Length();
if (qlen > 1e-6)
r.d = 1/qlen;
else
r.d = NAN;
}
}
}
@@ -0,0 +1,8 @@
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#include <vector>
#include "../common/Reflection.h"
#include "../common/UnitCell.h"
void UpdateReflectionResolution(const UnitCell &cell, std::vector<std::vector<Reflection> > &reflections);
@@ -355,21 +355,3 @@ ScalingResult ScaleOnTheFly::Scale(std::vector<std::vector<Reflection> > &reflec
return result;
}
void UpdateReflectionResolution(const UnitCell &cell, std::vector<std::vector<Reflection> > &reflections) {
CrystalLattice latt(cell);
const auto astar = latt.Astar();
const auto bstar = latt.Bstar();
const auto cstar = latt.Cstar();
for (auto &image: reflections) {
for (auto &r: image) {
Coord q = r.h * astar + r.k * bstar + r.l * cstar;
auto qlen = q.Length();
if (qlen > 1e6)
r.d = 1/qlen;
else
r.d = NAN;
}
}
}
@@ -22,8 +22,6 @@ struct ScaleOnTheFlyResult {
bool succesful = false;
};
void UpdateReflectionResolution(const UnitCell &cell, std::vector<std::vector<Reflection> > &reflections);
class ScaleOnTheFly {
constexpr static size_t MIN_REFLECTIONS = 20;
+2 -1
View File
@@ -29,6 +29,7 @@
#include "../image_analysis/scale_merge/Merge.h"
#include "../image_analysis/scale_merge/SearchSpaceGroup.h"
#include "../image_analysis/WriteMmcif.h"
#include "../image_analysis/UpdateReflectionResolution.h"
void print_usage(Logger &logger) {
logger.Info("Usage ./jfjoch_analysis {<options>} <input.h5>");
@@ -616,7 +617,7 @@ int main(int argc, char **argv) {
auto rejected_uc = CalcMergeMaskUnitCell(experiment, *consensus_cell, indexer.GetUnitCells(), merging_mask_uc);
if (rejected_uc > 0)
logger.Info("Rejected {} images for merging due to unit cell being too far from consensus", rejected_uc);
UpdateReflectionResolution(consensus_cell.value(), indexer.GetReflections());
// UpdateReflectionResolution(consensus_cell.value(), indexer.GetReflections());
logger.Info("Reflection resolution updated based on consensus unit cell");
} else
logger.Info("Consensus unit cell not found - calculation tool {:.2f} ms", consensus_duration * 1e3);
+1
View File
@@ -29,6 +29,7 @@
#include "../image_analysis/scale_merge/Merge.h"
#include "../image_analysis/scale_merge/SearchSpaceGroup.h"
#include "../image_analysis/WriteMmcif.h"
#include "../image_analysis/UpdateReflectionResolution.h"
void print_usage(Logger &logger) {
logger.Info("Usage ./jfjoch_analysis {<options>} <input.h5>");