Files
sf-op/script/Tools/SetTdsBeamPhase.py
gobbo_a 8beeb7dbc7
2023-08-17 15:16:51 +02:00

16 lines
512 B
Python

#Parameters
is_panel = get_exec_pars().source != CommandSource.ui # run from panel
if is_panel:
tds = args[0]
phase = args[1]
else:
tds = "S30CB14"
phase = 0.0
# set beam phase offset
phase_rf = caget(tds + "-RSYS:GET-VSUM-PHASE")
phase_corr = caget(tds + "-RSYS:GET-VSUM-PHASE-OFFSET-CORR")
phase_offset = phase - phase_rf - phase_corr
print(tds + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)
caput(tds + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)