Add a small dummy plan to find the beam centre - #123
Conversation
DominicOram
left a comment
There was a problem hiding this comment.
Thanks, minor comment
| beam_centre: CentreEllipseMethod = inject("beam_centre"), | ||
| ) -> MsgGenerator: | ||
| yield from bps.abs_set( | ||
| beam_centre.roi_box_size, 10000 |
There was a problem hiding this comment.
Should: Let's make this a bit more formal. Can you read the image size from the PV and then use the largest of width/height?
There was a problem hiding this comment.
Could: Or we could put this logic in the device itself? So you could set something like beam_centre.roi_box_size, None and it would do this.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
- Coverage 99.36% 98.77% -0.60%
==========================================
Files 33 34 +1
Lines 631 652 +21
==========================================
+ Hits 627 644 +17
- Misses 4 8 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DominicOram
left a comment
There was a problem hiding this comment.
Thanks, some comments in code
| roi_size = max(x_size, y_size) | ||
| yield from bps.abs_set(beam_centre.roi_box_size, roi_size) | ||
| LOGGER.info(f"Finding beam centre with roi_box_size set to {roi_size}") | ||
| yield from bps.trigger(beam_centre) |
There was a problem hiding this comment.
Should: the wait on trigger defaults to false for some reason, you probably want yield from bps.trigger(beam_centre, wait=True)
| x_size = yield from bps.rd(oav.grid_snapshot.x_size) | ||
| y_size = yield from bps.rd(oav.grid_snapshot.y_size) | ||
| roi_size = max(x_size, y_size) | ||
| yield from bps.abs_set(beam_centre.roi_box_size, roi_size) |
There was a problem hiding this comment.
Should: You want to make sure this is set before triggering, either with wait=True or change to a mv
| from i19_bluesky.log import LOGGER | ||
|
|
||
|
|
||
| def find_beam_centre_plan( |
There was a problem hiding this comment.
Could: It feels like this should actually return the found centre?
| x_size = yield from bps.rd(oav.grid_snapshot.x_size) | ||
| y_size = yield from bps.rd(oav.grid_snapshot.y_size) |
There was a problem hiding this comment.
Could: Can we use snapshot rather than grid_snapshot? Either is quite weird tbh but that's another issue
Closes #122