Commit 7604b919 authored by Yaroslav Gevorkov's avatar Yaroslav Gevorkov
Browse files

output matched peak count

parent 73245d07
......@@ -44,8 +44,8 @@ class PinkIndexer
PinkIndexer(const ExperimentSettings& experimentSettings, ConsideredPeaksCount consideredPeaksCount, AngleResolution angleResolution,
RefinementType refinementType, float maxResolutionForIndexing_1_per_A);
bool indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Eigen::Matrix2Xf& detectorPeaks_m, int threadCount);
bool indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Eigen::Matrix3Xf& meanReciprocalPeaks_1_per_A, int threadCount);
int indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Eigen::Matrix2Xf& detectorPeaks_m, int threadCount);
int indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Eigen::Matrix3Xf& meanReciprocalPeaks_1_per_A, int threadCount);
private:
void reducePeakCount(Eigen::Matrix3Xf& ucsDirections, Eigen::Array2Xf& ucsBorderNorms, Eigen::RowVectorXf& intensities,
......
#ifndef ADAPTIONS_CRYSTFEL_SIMPLE_DIFFRACTION_PATTERN_PREDICTION_H
#define ADAPTIONS_CRYSTFEL_SIMPLE_DIFFRACTION_PATTERN_PREDICTION_H
#include "ExperimentSettings.h"
#include "indexerData.h"
#include "projectionData.h"
......
......@@ -25,14 +25,14 @@ PinkIndexer::PinkIndexer(const ExperimentSettings& experimentSettings, Considere
sinogram.setSinogramAngleResolution(angleResolution_deg);
}
bool PinkIndexer::indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Matrix3Xf& meanReciprocalPeaks_1_per_A, int threadCount)
int PinkIndexer::indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Matrix3Xf& meanReciprocalPeaks_1_per_A, int threadCount)
{
Matrix2Xf detectorPeaks_m;
reciprocalToRealProjection.project(detectorPeaks_m, meanReciprocalPeaks_1_per_A);
return indexPattern(indexedLattice, intensities, detectorPeaks_m, threadCount);
}
bool PinkIndexer::indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Matrix2Xf& detectorPeaks_m, int threadCount)
int PinkIndexer::indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& intensities, const Matrix2Xf& detectorPeaks_m, int threadCount)
{
Matrix3Xf ucsDirections;
Array2Xf ucsBorderNorms;
......@@ -81,15 +81,17 @@ bool PinkIndexer::indexPattern(Lattice& indexedLattice, Eigen::RowVectorXf& inte
break;
}
int fittedPeaksCount = refinement.getFittedPeaksCount(indexedLattice, ucsDirections, ucsBorderNorms);
if ((fittedPeaksCount >= 20 && fittedPeaksCount >= detectorPeaks_m.cols() * 0.3) || fittedPeaksCount >= detectorPeaks_m.cols() * 0.5)
{
return true;
}
else
{
return false;
}
return refinement.getFittedPeaksCount(indexedLattice, ucsDirections, ucsBorderNorms);
//int fittedPeaksCount = refinement.getFittedPeaksCount(indexedLattice, ucsDirections, ucsBorderNorms);
//if ((fittedPeaksCount >= 20 && fittedPeaksCount >= detectorPeaks_m.cols() * 0.3) || fittedPeaksCount >= detectorPeaks_m.cols() * 0.5)
//{
// return true;
//}
//else
//{
// return false;
//}
// sinogram.saveToFile("C:\\DesyFiles\\workspaces\\VisualStudio_workspace\\pinkIndexer\\workfolder\\sinogram");
}
......
......@@ -95,7 +95,7 @@ extern "C" int PinkIndexer_indexPattern(PinkIndexer* pinkIndexer, Lattice_t* ind
Lattice indexedLattice_class;
Eigen::RowVectorXf intensities_class = Eigen::Map<Eigen::RowVectorXf>((float*)intensities, 1, peakCount);
bool indexed = pinkIndexer->indexPattern(indexedLattice_class, intensities_class, meanReciprocalPeaks_1_per_A_matrix, threadCount);
int matchedPeaksCount = pinkIndexer->indexPattern(indexedLattice_class, intensities_class, meanReciprocalPeaks_1_per_A_matrix, threadCount);
Eigen::Matrix3f basis = indexedLattice_class.getBasis();
indexedLattice->ax = basis(0, 0);
......@@ -108,5 +108,5 @@ extern "C" int PinkIndexer_indexPattern(PinkIndexer* pinkIndexer, Lattice_t* ind
indexedLattice->cy = basis(1, 2);
indexedLattice->cz = basis(2, 2);
return (int)indexed;
return matchedPeaksCount;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment