v1.0.0-rc.112 #18
@@ -102,7 +102,7 @@ void RotationIndexer::TryIndex() {
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<RotatinIndexerImageResult> RotationIndexer::ProcessImage(int64_t image, const std::vector<SpotToSave> &spots) {
|
||||
std::optional<RotationIndexerResult> RotationIndexer::ProcessImage(int64_t image, const std::vector<SpotToSave> &spots) {
|
||||
std::unique_lock ul(m);
|
||||
|
||||
// For non-rotation just ignore the whole procedure
|
||||
@@ -142,7 +142,7 @@ std::optional<RotatinIndexerImageResult> RotationIndexer::ProcessImage(int64_t i
|
||||
};
|
||||
|
||||
if (XtalOptimizer(data, spots))
|
||||
return RotatinIndexerImageResult{
|
||||
return RotationIndexerResult{
|
||||
.lattice = data.latt,
|
||||
.search_result = search_result_,
|
||||
.geom = data.geom
|
||||
@@ -152,8 +152,12 @@ std::optional<RotatinIndexerImageResult> RotationIndexer::ProcessImage(int64_t i
|
||||
}
|
||||
|
||||
|
||||
std::optional<CrystalLattice> RotationIndexer::Finalize(bool retry) {
|
||||
std::optional<RotationIndexerResult> RotationIndexer::Finalize(bool retry) {
|
||||
if (!indexed_lattice || retry)
|
||||
TryIndex();
|
||||
return indexed_lattice;
|
||||
return RotationIndexerResult{
|
||||
.lattice = indexed_lattice.value(),
|
||||
.search_result = search_result_,
|
||||
.geom = geom_
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// 3. If indexing is successful - lattice is provided that is used by subsequent images
|
||||
// 4. If indexing is not-successful - accumulation procedure is continued
|
||||
|
||||
struct RotatinIndexerImageResult {
|
||||
struct RotationIndexerResult {
|
||||
CrystalLattice lattice;
|
||||
LatticeSearchResult search_result;
|
||||
DiffractionGeometry geom;
|
||||
@@ -28,7 +28,7 @@ class RotationIndexer {
|
||||
mutable std::mutex m;
|
||||
const DiffractionExperiment& experiment;
|
||||
|
||||
constexpr static int64_t max_spots = 32768;
|
||||
constexpr static int64_t max_spots = 60000;
|
||||
constexpr static float min_accum_angle_deg = 20.0;
|
||||
constexpr static float stride_angle_deg = 0.5;
|
||||
constexpr static int64_t min_images_for_indexing = 10;
|
||||
@@ -57,8 +57,8 @@ class RotationIndexer {
|
||||
public:
|
||||
RotationIndexer(const DiffractionExperiment& x, IndexerThreadPool& indexer);
|
||||
void SetLattice(const CrystalLattice &lattice);
|
||||
std::optional<RotatinIndexerImageResult> ProcessImage(int64_t image, const std::vector<SpotToSave>& spots);
|
||||
std::optional<CrystalLattice> Finalize(bool retry);
|
||||
std::optional<RotationIndexerResult> ProcessImage(int64_t image, const std::vector<SpotToSave>& spots);
|
||||
std::optional<RotationIndexerResult> Finalize(bool retry);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -61,19 +61,19 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
auto latt_1 = rot_index.Finalize(false);
|
||||
if (latt_1) {
|
||||
auto uc = latt_1->GetUnitCell();
|
||||
auto uc = latt_1->lattice.GetUnitCell();
|
||||
logger.Info("Unit cell {} {} {} {} {} {}", uc.a, uc.b, uc.c, uc.alpha, uc.beta, uc.gamma);
|
||||
logger.Info("Latt1 {} {} {}", latt_1->Vec0().x, latt_1->Vec0().y, latt_1->Vec0().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_1->Vec1().x, latt_1->Vec1().y, latt_1->Vec1().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_1->Vec2().x, latt_1->Vec2().y, latt_1->Vec2().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_1->lattice.Vec0().x, latt_1->lattice.Vec0().y, latt_1->lattice.Vec0().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_1->lattice.Vec1().x, latt_1->lattice.Vec1().y, latt_1->lattice.Vec1().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_1->lattice.Vec2().x, latt_1->lattice.Vec2().y, latt_1->lattice.Vec2().z);
|
||||
}
|
||||
auto latt_2 = rot_index.Finalize(true);
|
||||
if (latt_2) {
|
||||
|
||||
auto uc = latt_2->GetUnitCell();
|
||||
auto uc = latt_2->lattice.GetUnitCell();
|
||||
logger.Info("Unit cell {} {} {} {} {} {}", uc.a, uc.b, uc.c, uc.alpha, uc.beta, uc.gamma);
|
||||
logger.Info("Latt1 {} {} {}", latt_2->Vec0().x, latt_2->Vec0().y, latt_2->Vec0().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_2->Vec1().x, latt_2->Vec1().y, latt_2->Vec1().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_2->Vec2().x, latt_2->Vec2().y, latt_2->Vec2().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_2->lattice.Vec0().x, latt_2->lattice.Vec0().y, latt_2->lattice.Vec0().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_2->lattice.Vec1().x, latt_2->lattice.Vec1().y, latt_2->lattice.Vec1().z);
|
||||
logger.Info("Latt1 {} {} {}", latt_2->lattice.Vec2().x, latt_2->lattice.Vec2().y, latt_2->lattice.Vec2().z);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user