Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 28m9s
Build Packages / Generate python client (push) Successful in 31s
Build Packages / Validation Battery (push) Successful in 47m56s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 26m51s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 10m33s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 26m49s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 30m10s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 32m0s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 32m49s
Build Packages / Create release (push) Successful in 8s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 16m57s
Build Packages / Build documentation (push) Successful in 47s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m7s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 29m33s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 21m36s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 24m26s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 30m56s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 32m3s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 30m50s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 28m52s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 25m22s
Build Packages / Unit tests (push) Successful in 1h44m43s
* Rugnux: Fixed indexing of stills of a centred lattice with a known cell. * jfjoch_broker (experimental): Live Rugnux processing of serial collections. * Rugnux: Stills detector modules are placed from the data and written to `<prefix>_module_placement.json`; `--panel-refine` replaces `--refine-modules`. * Rugnux: More reliable rotation processing - indexing, monoclinic setting, space-group choice and refinement of multi-domain twins. Reviewed-on: #93 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
60 lines
2.1 KiB
C++
60 lines
2.1 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include "FFBIDXIndexer.h"
|
|
#include "PostIndexingRefinement.h"
|
|
|
|
// The ffbidx library implements the TORO algorithm:
|
|
// Gasparotto et al. (2024) J. Appl. Cryst. 57, 931-944
|
|
|
|
void FFBIDXIndexer::SetupUnitCell(const std::optional<UnitCell> &cell) {
|
|
if (!cell.has_value())
|
|
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
|
"FFBIDX requires unit cell");
|
|
// Given the primitive cell of a centred lattice (IndexingCell); the lattices found are put back
|
|
// into the conventional cell in RunInternal.
|
|
const CrystalLattice l1 = IndexingCell(cell.value());
|
|
reference_unit_cell = l1.GetUnitCell();
|
|
|
|
Eigen::Matrix3f m;
|
|
indexer.iCellM() << l1.Vec0().x, l1.Vec0().y, l1.Vec0().z,
|
|
l1.Vec1().x, l1.Vec1().y, l1.Vec1().z,
|
|
l1.Vec2().x, l1.Vec2().y, l1.Vec2().z;
|
|
}
|
|
|
|
std::vector<CrystalLattice> FFBIDXIndexer::RunInternal(const std::vector<Coord> &coord, size_t nspots) {
|
|
std::vector<CrystalLattice> ret;
|
|
|
|
if (nspots > coord.size())
|
|
nspots = coord.size();
|
|
|
|
if (nspots < viable_cell_min_spots)
|
|
return ret;
|
|
|
|
assert(nspots <= MAX_SPOT_COUNT);
|
|
assert(coord.size() <= MAX_SPOT_COUNT);
|
|
|
|
for (int i = 0; i < coord.size(); i++) {
|
|
indexer.spotX(i) = coord[i].x;
|
|
indexer.spotY(i) = coord[i].y;
|
|
indexer.spotZ(i) = coord[i].z;
|
|
}
|
|
|
|
// Index
|
|
indexer.index(1, nspots);
|
|
|
|
RefineParameters parameters{
|
|
.viable_cell_min_spots = viable_cell_min_spots,
|
|
.dist_tolerance_vs_reference = dist_tolerance_vs_reference,
|
|
.reference_unit_cell = reference_unit_cell,
|
|
.min_length_A = 1, // doesn't matter
|
|
.max_length_A = 1000, // doesn't matter
|
|
.min_angle_deg = 30,
|
|
.max_angle_deg = 150,
|
|
.indexing_tolerance = indexing_tolerance
|
|
};
|
|
|
|
auto lattices = Refine(coord, nspots, indexer.oCellM(), indexer.oScoreV(), parameters);
|
|
return ToConventional(lattices);
|
|
}
|