v.1.0.0-rc.32

This commit is contained in:
2025-03-24 12:16:33 +01:00
parent 19be3575f0
commit a30707964d
176 changed files with 1360 additions and 710 deletions
+34 -1
View File
@@ -37,7 +37,7 @@ void IndexerWrapper::Setup(const UnitCell &cell) {
#endif
}
std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord, float indexing_threshold, int nspots) {
std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord, float indexing_threshold, size_t nspots) {
#ifdef JFJOCH_USE_CUDA
std::vector<IndexingResult> ret;
@@ -112,6 +112,39 @@ std::vector<IndexingResult> IndexerWrapper::Run(const std::vector<Coord> &coord,
#endif
}
void IndexerWrapper::Run(DataMessage &message,
const std::vector<DiffractionSpot> &spots,
const DiffractionGeometry &geom,
float indexing_threshold) {
size_t nspots = spots.size();
std::vector<Coord> recip;
recip.reserve(spots.size());
for (const auto &i: spots)
recip.push_back(i.ReciprocalCoord(geom));
std::vector<IndexingResult> ret;
if (nspots > 80)
ret = Run(recip, indexing_threshold, 50);
if (ret.empty())
ret = Run(recip, indexing_threshold, nspots);
if (!ret.empty()) {
message.indexing_result = true;
assert(ret[0].indexed_spot.size() == message.spots.size());
// identify indexed spots
for (int i = 0; i < message.spots.size(); i++)
message.spots[i].indexed = ret[0].indexed_spot[i];
message.indexing_lattice = ret[0].l.GetVector();
message.indexing_unit_cell = ret[0].l.GetUnitCell();
}
}
IndexerWrapper::IndexerWrapper() {
impl_ = std::make_unique<IndexerWrapperImpl>();
}