Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 7m27s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 8m20s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 7m35s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 5m59s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 7m25s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 8m30s
Build Packages / build:rpm (rocky8) (push) Successful in 7m39s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m16s
Build Packages / build:rpm (rocky9) (push) Successful in 9m35s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m6s
Build Packages / Generate python client (push) Successful in 12s
Build Packages / Build documentation (push) Successful in 31s
Build Packages / Create release (push) Skipped
Build Packages / XDS test (durin plugin) (push) Successful in 7m6s
Build Packages / DIALS test (push) Successful in 12m3s
Build Packages / XDS test (neggia plugin) (push) Successful in 5m11s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 5m50s
Build Packages / Unit tests (push) Successful in 57m33s
This is an UNSTABLE release. The release has significant modifications for data processing - in case of troubles go back to 1.0.0-rc.144. * jfjoch_viewer: Add reciprocal space viewer * jfjoch_process: Two pass algorithm that does spot finding/indexing + integration of full dataset * jfjoch_process: Improve logic for rotation indexer, to make execution more deterministic (still work in progress) Reviewed-on: #57 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch> Co-committed-by: Filip Leonarski <filip.leonarski@psi.ch>
46 lines
1.7 KiB
C++
46 lines
1.7 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include "RotationIndexerCounter.h"
|
|
|
|
RotationIndexerCounter::RotationIndexerCounter(const DiffractionExperiment &x) {
|
|
const auto axis = x.GetGoniometer();
|
|
|
|
if (x.IsRotationIndexing() && axis.has_value()) {
|
|
float angle_norm_deg = std::fabs(axis->GetIncrement_deg());
|
|
if (angle_norm_deg >= 1e-6) {
|
|
if (x.GetImageNum() < min_images_for_indexing) {
|
|
// For short measurements - no trying to index during the measurement
|
|
image_to_try_indexing = x.GetImageNum();
|
|
image_stride = 1;
|
|
} else {
|
|
image_to_try_indexing = std::max<int64_t>(min_images_for_indexing,
|
|
x.GetIndexingSettings().
|
|
GetRotationIndexingMinAngularRange_deg() / angle_norm_deg);
|
|
image_stride = std::ceil(
|
|
x.GetIndexingSettings().GetRotationIndexingAngularStride_deg() / angle_norm_deg);
|
|
if (image_stride == 0)
|
|
image_stride = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
std::pair<bool, bool> RotationIndexerCounter::Process(int64_t image) {
|
|
std::unique_lock ul(m);
|
|
|
|
std::pair<bool, bool> ret = {false, false};
|
|
|
|
if (image_stride == 0)
|
|
return ret;
|
|
|
|
accumulated_images++;
|
|
ret.first = (image_stride == 1) || (image % image_stride == 0);
|
|
if (accumulated_images >= image_to_try_indexing) {
|
|
image_to_try_indexing += 10;
|
|
ret.second = true;
|
|
}
|
|
|
|
return ret;
|
|
}
|