PostIndexingRefinement: Fix a bug in spot indexing cutoffs
This commit is contained in:
@@ -35,18 +35,22 @@ namespace {
|
||||
}
|
||||
|
||||
static inline std::vector<uint8_t> ComputeIndexedMask(
|
||||
const Eigen::Ref<const Eigen::MatrixX3<float>> &spots,
|
||||
const Eigen::Matrix3f &cell,
|
||||
float indexing_tolerance,
|
||||
int64_t &indexed_spot_count) {
|
||||
const Eigen::Ref<const Eigen::MatrixX3<float>> &spots,
|
||||
const Eigen::Matrix3f &cell,
|
||||
float indexing_tolerance,
|
||||
int64_t &indexed_spot_count) {
|
||||
const float indexing_tolerance_sq = indexing_tolerance * indexing_tolerance;
|
||||
const Eigen::MatrixX3<float> resid = CalculateResiduals(spots, cell);
|
||||
|
||||
// Compute fractional Miller indices
|
||||
Eigen::MatrixX3<float> miller_frac = spots * cell;
|
||||
Eigen::MatrixX3<float> miller_int = miller_frac.array().round().matrix();
|
||||
Eigen::MatrixX3<float> frac_resid = miller_frac - miller_int;
|
||||
|
||||
std::vector<uint8_t> mask(spots.rows(), 0);
|
||||
indexed_spot_count = 0;
|
||||
|
||||
for (int i = 0; i < spots.rows(); ++i) {
|
||||
if (resid.row(i).squaredNorm() < indexing_tolerance_sq) {
|
||||
if (frac_resid.row(i).squaredNorm() < indexing_tolerance_sq) {
|
||||
mask[i] = 1;
|
||||
indexed_spot_count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user