post-p21592 HVE commissioning cleanup

This commit is contained in:
2023-12-13 14:25:59 +01:00
parent a40a4be2b4
commit 7b9f3fa9b7
7 changed files with 346 additions and 43 deletions

View File

@ -1,4 +1,6 @@
import time
from time import sleep
import numpy as np
from epics import PV
@ -21,7 +23,7 @@ N_UNDS = list(range(3, 15 + 1))
# Cristallina without calibration
# offset is the difference between PSSS and undulator setpoint
# sign convention: Undulator - PSSS
energy_offset = -62 # eV
energy_offset = -59 # eV
# move the PSSS motor according to the energy
@ -390,9 +392,19 @@ class ScalerEK:
def get_machine_n_und_ref():
res = PVEnumAdjustable("SARUN:REF-UND").get()
if not res.startswith("SARUN"):
return None
for attempt in range(3):
try:
res = PVEnumAdjustable("SARUN:REF-UND").get()
if not res.startswith("SARUN"):
return None
except AttributeError as e:
print("Error getting undulator, retrying")
print(e)
time.sleep(1)
else:
break
n = len("SARUN")
res = res[n:]
try: