32 lines
861 B
Python
32 lines
861 B
Python
#Parameters
|
|
is_panel = get_exec_pars().source != CommandSource.ui # run from panel
|
|
if is_panel:
|
|
tds = args[0]
|
|
else:
|
|
tds = "S30CB14"
|
|
run("Tools/BunchLengthTDSdata.py")
|
|
|
|
# stop the beam and set rates to 1 Hz
|
|
if tds == "SATMA02":
|
|
caput("SIN-TIMAST-TMA:Bunch-2-OnDelay-Sel", 1)
|
|
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
|
|
else :
|
|
caput("SIN-TIMAST-TMA:Beam-RF-OnDelay-Sel", 1)
|
|
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
|
|
|
|
# collimators
|
|
if tds == "S30CB14":
|
|
caputq("SARCL02-VCOL290:GAP", gap_init[0])
|
|
|
|
# restore nominal optics
|
|
quads = tds_data[tds]["quads"]
|
|
for i in range(len(quads)):
|
|
caput(quads[i] + ":I-SET", i_set_init[i])
|
|
caput(quads[i] + ":CYCLE", 2)
|
|
|
|
#switch BLMs on
|
|
blm = tds_data[tds]["BLM"]
|
|
for i in range(len(blm)):
|
|
caput(blm[i] + ":B1_ROI_ACTIVE_OP", 1)
|
|
caput(blm[i] + ":B2_ROI_ACTIVE_OP", 1)
|