-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add ACR status option for CCM energy moves #1194
Conversation
pcdsdevices/ccm.py
Outdated
For HXR this usually is 'AO805'. | ||
""" | ||
vernier = FCpt(BeamEnergyRequest, '{hutch}', | ||
acr_status_suffix='AO805', |
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.
How do I use the acr_status_suffix here instead of hardcoding the 'AO805'?
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.
It looks like FormattedComponent
only allows you to format the suffix. DynamicDeviceComponent
also doesn't quite fit the bill. I don't see a Component type in ophyd or pcdsdevices that lets you format an arbitrary kwarg, but I feel like we must have done something like this before.
Maybe @ZLLentz has better memory than I do?
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.
There's a argument from Component
called add_prefix
that defaults to ("suffix", "write_pv")
, which is used to determine which string arguments we should prepend with the prefix. This is re-used in FormattedComponent
to determine which string arguments should be formatted. So, you could do:
vernier = FCpt(BeamEnergyRequest, '{hutch}',
acr_status_suffix='{acr_suffix}',
add_prefix=('suffix', 'acr_status_suffix')
def __init__(self, *args, **kwargs):
self.acr_suffix = 'AO805'
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.
Ah thanks, that's a neat backdoor. (or at least something I've never seen in the Component class)
Co-authored-by: Robert Tang-Kong <[email protected]>
…ng vernier (not wait) and K (wait) changes
@ZLLentz @tangkong I have pushed some more changes. We are going to test things this week with ACR so there will probably be more to come. I changed some naming, as to better reflect the reality of the use cases. While i feel this is making things less confusing in the long run, I don't know if that is not breaking things elsewhere. Can you advise? The changes are:
|
Recording what we discussed briefly on slack:
|
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 tested working live, right? I think it looks good. The vernier name change is still an api break but it's definitely more correct and probably ok.
This is just missing pre-release docs I think.
Addressed the comments. I am also working on a confluence page to go more in depth about the energy scanning schemes that we are using. |
So we did some self-seeding test recently, and I have added a couple commits related to that. Two things that I would like your input on:
|
I had remembered this being inherited from an older version of the code, but when I went to check I found that the original source used 3eV. My limited understanding is that if the move is small enough we don't want to wait for the energy to change, which can be a timely process.
It probably belongs in a utils module instead, but it could always be moved in a later refactor if needed. |
Ok, so moving to 0.5eV is fine. The Vernier change takes 0.2-0.3s, so it's comparable if not faster than the CCM. I'll move the reargs function to the utils.py here, it makes indeed more sense to have it there. |
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 looks good to me
Description
Add the ACR status PV for cases where we are moving the undulator or the K, which need to be waited on.
Motivation and Context
How Has This Been Tested?
In XPP3, with ACR changing the K value.
Where Has This Been Documented?
N/A
Pre-merge checklist