-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local indexing: take into account phi in nearest neighbour analysis #1459
Conversation
In the "local" index assignment method, the nearest neighbour analysis should only identify as neighbouring those reflections that are close in phi. If, for example, there is a rotation misset in a scan that is more than one full rotation, this previously could cause issues for the local index assignment, leading to low numbers of indexed reflections. Fixes #1458
Tested by manually modifying the scan oscillation for the
Results with previous behaviour:
Results with this PR:
|
Codecov Report
@@ Coverage Diff @@
## master #1459 +/- ##
==========================================
+ Coverage 65.66% 65.68% +0.01%
==========================================
Files 614 614
Lines 69490 69525 +35
Branches 9513 9515 +2
==========================================
+ Hits 45630 45665 +35
Misses 22022 22022
Partials 1838 1838 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very useful change that will improve indexing success for wide scans where experimental geometry is not static, or even static but bad initial geometry.
Is the I'm just mindful that |
Yes - the bug was only highlighted when using data sets with multiple full rotations. |
Generating "observations" is a bit of a strange dance that could be made easier. The way I've done it in the past does prediction twice, to first get rays that intersect the detector and then to get a reflection table that includes flags etc. Then you can set the observations from the predictions and invent some variances (for refinement). There are various messy examples in the refinement tests, like here: dials/test/algorithms/refinement/test_refinement_regression.py Lines 184 to 228 in 241d539
|
Modify insulin scan to ensure it covers multiple rotations and generate predicted centroids for the purposes of the test. This has the added bonus that we know exactly what are the correct miller indices to expect.
It turns out it's much easier in this case, as all I need are some observed centroids, so I can use @Anthchirp happy now? 🙂 |
I was already happy with your last response, but - yes, certainly 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important set of fixes thank you - wonder if your news fragment should include a comment for > 360° sweeps to aid the end user in understanding the significance of this?
af::init_functor_null<double>()); | ||
double* r = rlps_double.begin(); | ||
for (std::size_t i = 0; i < reciprocal_space_points.size(); i++) { | ||
for (std::size_t j = 0; j < 3; j++) { | ||
*r++ = reciprocal_space_points[i][j]; | ||
} | ||
*r++ = phi[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only comment here is that stuff like *r++
always gets me scratching my head as to whether ++
happens before or after the operation etc. - and we already know that this should be written to rlps_double[4*i+3]
- applies to the line above which is obviously unchanged as well.
Appreciate that this is consistent with the "house style" locally and does mean an increment vs. add/multiply but I wonder how much difference that makes to the runtime (i.e. compilers are clever & can unroll the add/multiply version vs. cannot unroll the increment version)
In the "local" index assignment method, the nearest neighbour analysis should only identify as neighbouring those reflections that are close in phi. If, for example, there is a rotation misset in a scan that is more than one full rotation, this previously could cause issues for the local index assignment, leading to low numbers of indexed reflections.
Fixes #1458