Mx-bluesky 221 document gridscan coordinate systems#958
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #958 +/- ##
=======================================
Coverage 97.38% 97.38%
=======================================
Files 143 143
Lines 6087 6087
=======================================
Hits 5928 5928
Misses 159 159 ☔ View full report in Codecov by Sentry. |
olliesilvester
left a comment
There was a problem hiding this comment.
Thanks, the extra documentation is really useful. A few suggestions in the comments
| centre_of_mass: The position of the centre of mass of the crystal, adjusted so that | ||
| grid box centres lie on integer grid coordinates, such that a 1x1x1 crystal detected in | ||
| a single grid box at 0, 0, 0, has c.o.m. of 0, 0, 0, not 0.5, 0.5, 0.5 | ||
| max_voxel: Position of the maximum voxel, in integer coordinates | ||
| max_count: max count achieved in a single voxel for the crystal | ||
| n_voxels: Number of voxels in the diffracting centre | ||
| total_count: Total of above-threshold spot counts in the labelled voxels | ||
| bounding_box: The rectangular prism that bounds the crystal, expressed | ||
| as the volume of whole boxes as a half-open range i.e such that | ||
| p1 = (x1, y1, z1) <= p < p2 = (x2, y2, z2) and | ||
| p2 - p1 gives the dimensions in whole voxels. |
There was a problem hiding this comment.
Very useful comments! I think it's also worth mentioning that (0,0) corresponds to the top left.
There was a problem hiding this comment.
Also that p1 and p2 refer to the top left and bottom right of the prism
There was a problem hiding this comment.
I'm going to wait until I have more feedback on DiamondLightSource/python-dlstbx#263 before I assert that 0,0 is at the top-left - it may not actually be true depending on where the snake scan starts!
| centre_of_mass: The position of the centre of mass of the crystal, adjusted so that | ||
| grid box centres lie on integer grid coordinates, such that a 1x1x1 crystal detected in | ||
| a single grid box at 0, 0, 0, has c.o.m. of 0, 0, 0, not 0.5, 0.5, 0.5 | ||
| max_voxel: Position of the maximum voxel, in integer coordinates |
There was a problem hiding this comment.
When I first read this, I assumed a voxel was a different thing to a box
| max_voxel: Position of the maximum voxel, in integer coordinates | |
| max_voxel: Position of the box with the largest integer coordinates |
Also, what exactly do we mean by maximum coordinates? Is (5,0) larger than (0,5)?
There was a problem hiding this comment.
maximum voxel means the voxel with the highest spot count, not the box with the highest coordinates
| a single grid box at 0, 0, 0, has c.o.m. of 0, 0, 0, not 0.5, 0.5, 0.5 | ||
| max_voxel: Position of the maximum voxel, in integer coordinates | ||
| max_count: max count achieved in a single voxel for the crystal | ||
| n_voxels: Number of voxels in the diffracting centre |
There was a problem hiding this comment.
| n_voxels: Number of voxels in the diffracting centre | |
| n_voxels: Number of boxes in the diffracting centre |
| yield from bps.trigger(zocalo_device) | ||
| full_results = yield from get_full_processing_results(zocalo_device) | ||
| assert len(full_results) == 3 | ||
| assert len(full_results) == 5 |
There was a problem hiding this comment.
| assert len(full_results) == 5 | |
| assert len(full_results) == len(TEST_RESULTS) |
5a2ae11 to
6530f4a
Compare
Fixes DiamondLightSource/mx-bluesky#221 in particular the issue discovered in DiamondLightSource/mx-bluesky#697
See also DiamondLightSource/mx-bluesky#715
This issue was caused by a soft-signal in the
ZocaloResultsdevice being of integer type and causing a rounding issue.Adds additional documentation and comments describing how the centre-of-mass and bounding boxes of the results from Zocalo are represented and transformed.
Instructions to reviewer on how to test:
when performing a gridscan (this happens maybe ~10% of the time or slightly more when the crystal is near the edge of the grid
Checks for reviewer
dodal connect ${BEAMLINE}