pcdshub / engineering_tools

A repository of scripts, configuration useful for the PCDS team
Other
4 stars 26 forks source link

feat(set_gem_timing): allowing operators to switch between HXR-GEM SC and NC timing with a one line script #163

Closed joshc-slac closed 1 year ago

joshc-slac commented 1 year ago

Adding what should be a temporary hack script but may be somewhat long lived to provide a one line mechanism for operators to switch the timing paradigm on the HXR-GEM. This script:

Invokation once sourced is of form: set_gem_timing [scheme] Schemes besides NC and SC will be rejected.

Associated PR: https://github.com/pcdshub/IocManager/pull/9

Description

The set_gem_timing bash script critically:

Argument and State Parsing

Motivation and Context

Ticket ECS-3765 requests a script to switch timing of the HXR-GEMs for the NC and SC timing schemas.

For the SC timing schema the crate that contains the HXR-GEM cannot be upgraded (or is prohibitively expensive to upgrade) which means the non SLAC EVR cannot receive / decode LCLS2 timing pulses.

To circumvent this Silke hardwired the LCLS2 timing signal from the IM2K0 to the HXR-GEM enabling LCLS2 timing to be passed to the L, hard x-ray, side of things. This means that as long as the hack exists and we want to collect SC (LCLSII) data on the HXR-GEM we need to toggle the IOC software to be the one that ignores timing and triggers when the IM2K0 camera triggers and we need a mechanism to toggle it back when we want to send NC beam to the HXR-GEM and get the additional information (timestamps) provided by actually going through the EVR on the crate.

This toggle can be accomplished manually:

This script aims to deprecate both manual mechanisms GUI and CLI in switching between timing paradigms in favor of a one line command. This command can be plumbed into a button if desired.

How Has This Been Tested?

TODO:

Where Has This Been Documented?

ZLLentz commented 1 year ago

Also, an aside: thank you for being detailed and clear in the PR description here, it made it much easier to understand the intent of the code. I think the script is overall very good.

ZLLentz commented 1 year ago

I would not be opposed to a merge if the intent is "get the script out now, working, with a tagged version". I only found one potential edge case, which technically shouldn't ever happen.

joshc-slac commented 1 year ago

Following up on the remaining TODO:

Based on this slack feedback it seems operators do not normally operate with dotfiles sourced.

This makes sense, so I will make the script source the needed elements for them so it is truly a one stop shop. I have scheduled time with ACR to observe them using this tooling. Planning on closing this out after that confirmation.

joshc-slac commented 1 year ago

Following up on the remaining TODO:

Based on this slack feedback it seems operators do not normally operate with dotfiles sourced.

This makes sense, so I will make the script source the needed elements for them so it is truly a one stop shop. I have scheduled time with ACR to observe them using this tooling. Planning on closing this out after that confirmation.

Following up on this. Ran through utilizing this with ACR. Scripts seem sufficient for their needs.

There was a lingering complaint about ssh-tunneling. This could be resolved given sufficient GUI

silkenelson commented 1 year ago

Following up on the remaining TODO: Based on this slack feedback it seems operators do not normally operate with dotfiles sourced. This makes sense, so I will make the script source the needed elements for them so it is truly a one stop shop. I have scheduled time with ACR to observe them using this tooling. Planning on closing this out after that confirmation.

Following up on this. Ran through utilizing this with ACR. Scripts seem sufficient for their needs.

There was a lingering complaint about ssh-tunneling. This could be resolved given sufficient GUI

I would skip that. If ACR wants it more convenient, they can make take are of it - I believe Matt Gibbs made them something easier for the PMPS GUI.