v1.0.0-rc.40
This commit is contained in:
@@ -3,9 +3,8 @@
|
||||
|
||||
#include "MXAnalyzer.h"
|
||||
#include "CPUSpotFinder.h"
|
||||
#include "../common/DiffractionGeometry.h"
|
||||
#include "Regression.h"
|
||||
#include "../common/CUDAWrapper.h"
|
||||
#include "indexing/IndexerFactory.h"
|
||||
|
||||
double stddev(const std::vector<float> &v) {
|
||||
if (v.size() <= 1)
|
||||
@@ -26,17 +25,8 @@ double stddev(const std::vector<float> &v) {
|
||||
|
||||
|
||||
MXAnalyzer::MXAnalyzer(const DiffractionExperiment &in_experiment)
|
||||
: experiment(in_experiment) {
|
||||
auto uc = experiment.GetUnitCell();
|
||||
if (uc && (get_gpu_count() > 0)) {
|
||||
try {
|
||||
indexer = std::make_unique<IndexerWrapper>();
|
||||
indexer->Setup(uc.value());
|
||||
} catch (const std::exception &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::GPUCUDAError, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
: experiment(in_experiment), integrate(in_experiment) {
|
||||
indexer = CreateIndexer(experiment);
|
||||
if (experiment.IsSpotFindingEnabled())
|
||||
find_spots = true;
|
||||
}
|
||||
@@ -160,7 +150,6 @@ uint32_t MXAnalyzer::FilterSpotsInPowderRings(const std::vector<DiffractionSpot>
|
||||
}
|
||||
|
||||
void MXAnalyzer::Process(DataMessage &message, const SpotFindingSettings& settings) {
|
||||
message.indexing_result = false;
|
||||
if (!find_spots)
|
||||
return;
|
||||
|
||||
@@ -179,8 +168,12 @@ void MXAnalyzer::Process(DataMessage &message, const SpotFindingSettings& settin
|
||||
for (const auto &spot: spots_out)
|
||||
message.spots.push_back(spot);
|
||||
|
||||
if (indexer && settings.indexing)
|
||||
indexer->Run(message, spots_out, experiment.GetDiffractionGeometry(), settings.indexing_tolerance);
|
||||
if (indexer && settings.indexing) {
|
||||
auto latt = indexer->Run(message, spots_out);
|
||||
|
||||
if (latt && settings.quick_integration)
|
||||
message.reflections = integrate.Integrate(message.image, latt.value());
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<float> &MXAnalyzer::GetCPUMean() const {
|
||||
|
||||
Reference in New Issue
Block a user