Skip to content
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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

shihab-dls
Copy link
Collaborator

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.

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.01%. Comparing base (b663970) to head (d1a408a).

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           
Components Coverage Δ
i24 SSX 72.84% <ø> (ø)
hyperion 96.54% <100.00%> (+<0.01%) ⬆️
other 96.59% <ø> (ø)

Copy link
Contributor

@olliesilvester olliesilvester left a 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:
Copy link
Contributor

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

Copy link
Contributor

@DominicOram DominicOram left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants