Commit 29f081a5 authored by Yaroslav Gevorkov's avatar Yaroslav Gevorkov
Browse files

Documentation (with Oleksandr)

parent e955ee90
......@@ -118,12 +118,12 @@ namespace pinkIndexer
break;
case RefinementType::firstFixedThenVariableLatticeParametersMultiSeed:
{
constexpr int refinementTries = 1000;
constexpr int refinementTries = 1000; //TODO: increase if better refinement needed
int fittedNodesCount[refinementTries];
double fittedNodesMeanDefects[refinementTries];
Lattice fittedLattices[refinementTries];
float maxRelativeDeviation = 0.0125;
float maxRelativeDeviation = 0.0125; //TODO: Parameter??
Array<float, 1, 3> columnDeviationNorms = indexedLattice.getBasis().colwise().norm() * maxRelativeDeviation;
#ifdef OPENMP_AVAILABLE
......@@ -164,7 +164,7 @@ namespace pinkIndexer
// (fittedNodesCount[i] == maxFittedNodesCount && fittedNodesMeanDefects[i] < minFittedNodesMeanDefect))
if (fittedNodesCount[i] / maxFittedNodesCount > 1.2 ||
((fittedNodesCount[i] > maxFittedNodesCount || fittedNodesMeanDefects[i] < minFittedNodesMeanDefect) &&
(fittedNodesCount[i] / maxFittedNodesCount - 1) * 3 > (minFittedNodesMeanDefect / fittedNodesMeanDefects[i] - 1)))
(fittedNodesCount[i] / maxFittedNodesCount - 1) * 3 > (minFittedNodesMeanDefect / fittedNodesMeanDefects[i] - 1))) //TODO: can be optimized
{
maxFittedNodesCount = fittedNodesCount[i];
minFittedNodesMeanDefect = fittedNodesMeanDefects[i];
......@@ -175,7 +175,7 @@ namespace pinkIndexer
break;
case RefinementType::firstFixedThenVariableLatticeParametersCenterAdjustmentMultiSeed:
{
constexpr int refinementTries = 2000;
constexpr int refinementTries = 2000; //TODO: increase if better refinement needed
int fittedNodesCount[refinementTries];
double fittedNodesMeanDefects[refinementTries];
Lattice fittedLattices[refinementTries];
......@@ -203,7 +203,7 @@ namespace pinkIndexer
currentBasis = indexedLattice.getBasis();
}
fittedLattices[i] = Lattice(currentBasis);
centerShifts[i] = Vector2f::Random() * 80e-6;
centerShifts[i] = Vector2f::Random() * 80e-6; //TODO: hardcoded JUNGFRAU pixel size. Can be improved (maybe parameter??)
refinement.setTolerance(min(finalRefinementTolerance * 2.5, 0.12));
refinement.refineFixedLattice(fittedLattices[i], ucsDirections, ucsBorderNorms);
......
......@@ -32,7 +32,7 @@ namespace pinkIndexer
void Refinement::refineVariableLattice(Lattice& lattice, const Matrix3Xf& ucsDirections, const Array2Xf& ucsBorderNorms)
{
Matrix3f basis = lattice.getBasis();
float delta = 1e-8;
float delta = 1e-8; //for numerical differentiation, in A^-1
float stepSize = lattice.getBasisVectorNorms().maxCoeff() * 0.002;
float minStepSize = lattice.getBasisVectorNorms().minCoeff() * 0.00001;
......@@ -43,7 +43,7 @@ namespace pinkIndexer
{
// cout << meanDefects[i] << endl;
Array33f gradient;
Array33f gradient; //gradient for change of each basis matrix element
Matrix3f offsetBasis = basis;
offsetBasis(0, 0) += delta;
gradient(0, 0) = getMeanDefect(offsetBasis, ucsDirections, ucsBorderNorms, false) - meanDefects[i];
......
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