-
Notifications
You must be signed in to change notification settings - Fork 2
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
Set undulator gap after XBPM is stable #726
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #726 +/- ##
=======================================
Coverage 87.00% 87.01%
=======================================
Files 101 101
Lines 6966 6969 +3
=======================================
+ Hits 6061 6064 +3
Misses 905 905
|
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.
Looks good!
I have a nit in the undulator device, which is that this logging message is sent regardless of whether or not the gap is moved:
LOGGER.info(f"Setting undulator gap to {energy_kev:.2f} kev")
.
Eg we may run set
, and then find that the gap is already correct, so the above logging message is a bit misleading.
@@ -307,6 +307,10 @@ def _move_and_rotation( | |||
params: RotationScan, | |||
oav_params: OAVParameters, | |||
): | |||
if params.demand_energy_ev: |
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.
Could: add a brief comment to explain why we're doing this, as it probably looks like a weird thing to do without context of the issue. Something like
Verify Undulator gap is correct as it sometimes has the wrong value after a beam dump
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.
If we're concerned about it coming back after a beam dump then we should probably put the check in transmission_and_xbpm_feedback_for_collection_wrapper
as this is what is always run straight after a beam dump
Should address #518, where Undulator gap is incorrect following beam dump.
the Undulator device checks if we are already at the correct gap when set; therefore, this PR sets the gap after XBPM is stable (in transmission_and_xbpm_feedback_for_collection_decorator), and before collection, without checking first.