RotationIndexer: Only one indexing try after enough rotation
Build Packages / Generate python client (push) Has been cancelled
Build Packages / build:rpm (ubuntu2404) (push) Has been cancelled
Build Packages / Build documentation (push) Has been cancelled
Build Packages / Unit tests (push) Has been cancelled
Build Packages / Create release (push) Has been cancelled
Build Packages / build:rpm (rocky8_sls9) (push) Has started running
Build Packages / build:rpm (rocky9_nocuda) (push) Has been cancelled
Build Packages / build:rpm (rocky8_nocuda) (push) Has been cancelled
Build Packages / build:rpm (rocky8) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2204) (push) Has been cancelled
Build Packages / build:rpm (rocky9) (push) Has been cancelled
Build Packages / Generate python client (push) Has been cancelled
Build Packages / build:rpm (ubuntu2404) (push) Has been cancelled
Build Packages / Build documentation (push) Has been cancelled
Build Packages / Unit tests (push) Has been cancelled
Build Packages / Create release (push) Has been cancelled
Build Packages / build:rpm (rocky8_sls9) (push) Has started running
Build Packages / build:rpm (rocky9_nocuda) (push) Has been cancelled
Build Packages / build:rpm (rocky8_nocuda) (push) Has been cancelled
Build Packages / build:rpm (rocky8) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Has been cancelled
Build Packages / build:rpm (ubuntu2204) (push) Has been cancelled
Build Packages / build:rpm (rocky9) (push) Has been cancelled
This commit is contained in:
@@ -41,6 +41,8 @@ void RotationIndexer::SetLattice(const CrystalLattice &lattice) {
|
||||
}
|
||||
|
||||
void RotationIndexer::TryIndex() {
|
||||
indexing_tried = true;
|
||||
|
||||
// Index
|
||||
std::vector<SpotToSave> v_sel;
|
||||
std::vector<Coord> coords_sel;
|
||||
@@ -57,7 +59,6 @@ void RotationIndexer::TryIndex() {
|
||||
idx.begin() + max_spots,
|
||||
idx.end(),
|
||||
[this](std::size_t a, std::size_t b) {
|
||||
// Replace `.intensity` with the actual SpotToSave intensity member
|
||||
return v_[a].intensity > v_[b].intensity;
|
||||
}
|
||||
);
|
||||
@@ -111,7 +112,7 @@ std::optional<RotationIndexerResult> RotationIndexer::ProcessImage(int64_t image
|
||||
|
||||
const auto rot = axis_->GetTransformation(image);
|
||||
|
||||
if (!indexed_lattice && image >= last_accumulated_image + image_stride) {
|
||||
if (!indexing_tried && image >= last_accumulated_image + image_stride) {
|
||||
v_.reserve(v_.size() + spots.size());
|
||||
coords_.reserve(coords_.size() + spots.size());
|
||||
|
||||
@@ -125,29 +126,16 @@ std::optional<RotationIndexerResult> RotationIndexer::ProcessImage(int64_t image
|
||||
accumulated_images++;
|
||||
last_accumulated_image = image;
|
||||
|
||||
if (!indexed_lattice && accumulated_images >= min_images_for_indexing && image >= first_image_to_try_indexing) {
|
||||
if (accumulated_images >= min_images_for_indexing && image >= first_image_to_try_indexing)
|
||||
TryIndex();
|
||||
// If fails increase rotation range by a factor of two
|
||||
if (!indexed_lattice)
|
||||
first_image_to_try_indexing *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (indexed_lattice) {
|
||||
return RotationIndexerResult{
|
||||
.lattice = indexed_lattice->Multiply(rot.transpose()),
|
||||
.search_result = search_result_,
|
||||
.geom = updated_geom_
|
||||
};
|
||||
}
|
||||
return {};
|
||||
return GetLattice();
|
||||
}
|
||||
|
||||
std::optional<RotationIndexerResult> RotationIndexer::Finalize() {
|
||||
std::optional<RotationIndexerResult> RotationIndexer::GetLattice() {
|
||||
if (!indexed_lattice)
|
||||
TryIndex();
|
||||
if (!indexed_lattice)
|
||||
return std::nullopt;
|
||||
return {};
|
||||
return RotationIndexerResult{
|
||||
.lattice = indexed_lattice.value(),
|
||||
.search_result = search_result_,
|
||||
|
||||
Reference in New Issue
Block a user