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

36 lines
1.2 KiB
Python

# stop the beam
caput("SARCL02-MBND100:USER-DELTA-ENE-STATE", 1)
caput("SIN-TIMAST-TMA:Beam-RF-OnDelay-Sel", 1)
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
# read channels
dE = caget("SARCL02-MBND100:USER-DELTA-ENE")
S30_GAIN = caget("S30:SET-E-GAIN-OP")
SARCL02_P_SET = caget("SARCL02-MBND100:P-SET")
SARBD01_P_SET = caget("SARBD01-MBND100:P-SET")
# set new energy set-points
S30_GAIN = S30_GAIN + dE
SARCL02_P_SET = SARCL02_P_SET + dE
SARBD01_P_SET = SARBD01_P_SET + dE
caput("S30:SET-E-GAIN-OP", S30_GAIN)
caput("SARCL02-MBND100:P-SET", SARCL02_P_SET)
caput("SARBD01-MBND100:P-SET", SARBD01_P_SET)
# adjust optics to new energy
caput("S30:OPTICS-ONOFF-OP", 1)
caput("SAR:OPTICS-ONOFF-OP", 1)
time.sleep(10)
# start the beam at 1 Hz
caput("SIN-TIMAST-TMA:Beam-RF-OnDelay-Sel", 0)
caput("SIN-TIMAST-TMA:Bunch-1-Freq-Sel", 10)
caput("SIN-TIMAST-TMA:Bunch-2-Freq-Sel", 10)
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
time.sleep(10)
# beam at 10 Hz
caput("SIN-TIMAST-TMA:Bunch-1-Freq-Sel", 6)
caput("SIN-TIMAST-TMA:Bunch-2-Freq-Sel", 6)
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
time.sleep(10)
# optics feedback off
caput("S30:OPTICS-ONOFF-OP", 0)
caput("SAR:OPTICS-ONOFF-OP", 0)
caput("SARCL02-MBND100:USER-DELTA-ENE-STATE", 0)