This commit is contained in:
Executable → Regular
+8
-10
@@ -22,7 +22,7 @@ else:
|
||||
stop = 95.0
|
||||
step = 0.5
|
||||
nb = 3
|
||||
lat = 0.15
|
||||
lat = 0.4
|
||||
disp = -0.387
|
||||
p0 = 7.1
|
||||
plt = plot(None, title="Output")[0]
|
||||
@@ -44,7 +44,8 @@ plt.setLegendVisible(True)
|
||||
|
||||
#Creating Phase positioner
|
||||
if dry_run:
|
||||
phase = Positioner("Gun Phase", "SINEG01-RSYS:SET-BEAM-PHASE-SIM", "SINEG01-RSYS:SET-BEAM-PHASE-SIM")
|
||||
#phase = Positioner("Gun Phase", "SINEG01-RSYS:SET-BEAM-PHASE-SIM", "SINEG01-RSYS:SET-BEAM-PHASE-SIM")
|
||||
phase = DummyPositioner("Gun Phase")
|
||||
camera_name = "simulation"
|
||||
else:
|
||||
phase = Positioner("Gun Phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE")
|
||||
@@ -88,7 +89,7 @@ def after_sample(record, scan):
|
||||
#The scan loop
|
||||
try:
|
||||
phase.write(start)
|
||||
time.sleep(2.0)
|
||||
time.sleep(1.0)
|
||||
r = lscan(phase, [x_averager, dx_averager], start, stop, step , latency=lat, after_read = after_sample)
|
||||
finally:
|
||||
phase.write(phase0)
|
||||
@@ -142,14 +143,11 @@ if do_elog:
|
||||
title = "Gun Energy Scan"
|
||||
Laser = str(caget("SLG-LGEN:WHICH_LASER"))
|
||||
log_msg = "Data file: " + get_exec_pars().path + "\n\n"
|
||||
log_msg = log_msg + "Laser: " + Laser + "\n"
|
||||
if Laser == "Alcor":
|
||||
log_msg = log_msg + "Bunch: " + Laser + "\n"
|
||||
if Laser == "Bunch 1":
|
||||
log_msg = log_msg + "Energy plate Alcor: %0.2f" % caget("SLAUV01-LATN100:MOT.RBV") + " deg \n"
|
||||
elif Laser == "Jaguar":
|
||||
log_msg = log_msg + "Energy plate Jaguar: %0.2f" % caget("SLJUV01-LATN100:MOT.RBV") + " deg \n"
|
||||
elif Laser == "Both":
|
||||
log_msg = log_msg + "Energy plate Alcor: %0.2f" % caget("SLAUV01-LATN100:MOT.RBV") + " deg \n"
|
||||
log_msg = log_msg + "Energy plate Jaguar: %0.2f" % caget("SLJUV01-LATN100:MOT.RBV") + " deg \n"
|
||||
elif Laser == "Bunch 2":
|
||||
log_msg = log_msg + "Energy plate Mizar: %0.2f" % caget("SLMUV01-LATN100:MOT.RBV") + " deg \n"
|
||||
if caget("SLAUV01-LAPT100:IRIS-POS-GET") == "IRIS":
|
||||
log_msg = log_msg + "Collimator Alcor: IRIS %0.2f" % caget("SLAUV01-LAPT100:SIZE-GET") + " mm \n"
|
||||
else:
|
||||
|
||||
Executable → Regular
+25
-7
@@ -1,20 +1,38 @@
|
||||
station = "S10CB09"
|
||||
dE = 233.5# MeV
|
||||
# single station calibration, dE is the desired energy gain (measured with bends: station on-station off)
|
||||
# the scaling factors A,P are updated, the Acc voltage is set to dE, the V-Sum Amplitude and power should not change
|
||||
station = "SINSB01"
|
||||
dE = 77.25 # MeV
|
||||
do_elog = True
|
||||
|
||||
# set RF on-delay
|
||||
caput("SIN-TIMAST-TMA:Beam-RF-OnDelay-Sel", 1)
|
||||
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
|
||||
|
||||
# scale RF calibration
|
||||
A1 = caget(station + "-RSYS:SET-VSUM-AMPLT-SCALE") # MV/unit
|
||||
P1 = caget(station + "-RSYS:SET-VOLT-POWER-SCALE") # MW/MV^2
|
||||
VSA = caget(station + "-RSYS:GET-VSUM-AMPLT") # unit
|
||||
PWR = caget(station + "-RSYS:GET-KLY-POWER-GATED") # MW
|
||||
ACC1 = caget(station + "-RSYS:SET-ACC-VOLT") # MV
|
||||
|
||||
print(A1,P1,VSA,PWR,ACC1)
|
||||
A2 = dE / VSA
|
||||
P2 = PWR / dE**2
|
||||
ACC2 = ACC1 * A2 / A1
|
||||
|
||||
ACC2 = dE
|
||||
caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", A2)
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE", P2)
|
||||
time.sleep(2.0)
|
||||
caput(station + "-RSYS:SET-ACC-VOLT", ACC2)
|
||||
print(A2,P2,ACC2)
|
||||
time.sleep(2.0)
|
||||
VSA = caget(station + "-RSYS:GET-VSUM-AMPLT") # unit
|
||||
PWR = caget(station + "-RSYS:GET-KLY-POWER-GATED") # MW
|
||||
print(A2,P2,VSA,PWR,ACC2)
|
||||
|
||||
#caget S30CB01-RSYS:{SET-VSUM-AMPLT-SCALE,SET-VOLT-POWER-SCALE,GET-VSUM-AMPLT,GET-KLY-POWER-GATED,SET-ACC-VOLT}
|
||||
#Elog entry
|
||||
if do_elog:
|
||||
title = "Energy calibration" + station
|
||||
log_msg = "Old energy gain: %0.2f" % ACC1 + " MeV/c\n"
|
||||
log_msg = log_msg + "New energy gain: %0.2f" % ACC2 + " MeV/c\n\n"
|
||||
log_msg = log_msg + " A1 A2 P1 P2 \n"
|
||||
log_msg = log_msg + station + "%10.2f%10.2f%10.6f%10.6f" % (A1,A2,P1,P2) + " \n"
|
||||
attachments = None
|
||||
elog(title, log_msg)
|
||||
|
||||
Executable → Regular
+35
-22
@@ -1,47 +1,60 @@
|
||||
E1 = 1962.0 # old energy gain
|
||||
E2 = 1950.0 # new energy gain
|
||||
|
||||
# global energy scaling for a group of station (normally one full linac)
|
||||
# dE1 and dE2 are the old and new energy gains (from bends)
|
||||
dE1 = 1951.00 # old energy gain
|
||||
dE2 = 1950.00 # new energy gain
|
||||
do_elog = True
|
||||
|
||||
#stationlist = ("SINSB01","SINSB02","SINSB03","SINSB04","SINXB01")
|
||||
#stationlist = ("S10CB01","S10CB02","S10CB03","S10CB04","S10CB05","S10CB06","S10CB07","S10CB08","S10CB09")
|
||||
stationlist = ("S10CB01","S10CB02","S10CB03","S10CB04","S10CB05","S10CB06","S10CB07","S10CB08","S10CB09")
|
||||
#stationlist = ("S20CB01","S20CB02","S20CB03","S20CB04")
|
||||
#stationlist = ("S30CB01","S30CB02","S30CB03","S30CB04","S30CB05","S30CB06","S30CB07","S30CB08","S30CB09","S30CB10","S30CB11","S30CB12","S30CB13")
|
||||
stationlist = ("S10CB01","S10CB02","S10CB03","S10CB04","S10CB05","S10CB06","S10CB07","S10CB08","S10CB09")
|
||||
|
||||
do_VRF = True
|
||||
VRFGAIN = "S10:SET-E-GAIN-OP"
|
||||
#VRFGAIN = "S20:SET-E-GAIN-OP"
|
||||
#VRFGAIN = "S30:SET-E-GAIN-OP"
|
||||
|
||||
# set RF on-delay
|
||||
caput("SIN-TIMAST-TMA:Beam-RF-OnDelay-Sel", 1)
|
||||
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
|
||||
time.sleep(1.0)
|
||||
|
||||
# energy calibration
|
||||
A1, A2 = {}, {}
|
||||
P1, P2 = {}, {}
|
||||
new_acc_volt = {}
|
||||
A1, P1, VSA1, PWR1, ACC1 = {}, {}, {}, {}, {}
|
||||
A2, P2, VSA2, PWR2, ACC2 = {}, {}, {}, {}, {}
|
||||
for station in stationlist:
|
||||
A = caget(station + "-RSYS:SET-VSUM-AMPLT-SCALE") # MV/unit
|
||||
P = caget(station + "-RSYS:SET-VOLT-POWER-SCALE") # MW/MV^2
|
||||
vsum_ampl = caget(station + "-RSYS:GET-VSUM-AMPLT") # unit
|
||||
VSA = caget(station + "-RSYS:GET-VSUM-AMPLT") # unit
|
||||
PWR = caget(station + "-RSYS:GET-KLY-POWER-GATED") # MW
|
||||
ACC = caget(station + "-RSYS:SET-ACC-VOLT") # MV
|
||||
A1[station] = A
|
||||
A2[station] = A * E2 / E1
|
||||
P1[station] = P
|
||||
P2[station] = P * (E1 / E2)**2
|
||||
new_acc_volt[station] = vsum_ampl * A2[station]
|
||||
for station in stationlist:
|
||||
VSA1[station] = VSA
|
||||
PWR1[station] = PWR
|
||||
ACC1[station] = ACC
|
||||
A2[station] = A * dE2 / dE1
|
||||
P2[station] = P * (dE1 / dE2)**2
|
||||
ACC2[station] = ACC * dE2 / dE1
|
||||
caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", A2[station])
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE", P2[station])
|
||||
caput(station + "-RSYS:SET-ACC-VOLT", new_acc_volt[station])
|
||||
|
||||
# set RF on-beam
|
||||
caput("SIN-TIMAST-TMA:Beam-RF-OnDelay-Sel", 0)
|
||||
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1)
|
||||
caput(station + "-RSYS:SET-ACC-VOLT", ACC2[station])
|
||||
if do_VRF:
|
||||
caput(VRFGAIN, dE2)
|
||||
time.sleep(10.0)
|
||||
for station in stationlist:
|
||||
VSA = caget(station + "-RSYS:GET-VSUM-AMPLT") # unit
|
||||
PWR = caget(station + "-RSYS:GET-KLY-POWER-GATED") # MW
|
||||
VSA2[station] = VSA
|
||||
PWR2[station] = PWR
|
||||
|
||||
#Elog entry
|
||||
if do_elog:
|
||||
title = "Energy calibration scaling"
|
||||
log_msg = "Old energy gain: %0.2f" % E1 + " MeV/c\n"
|
||||
log_msg = log_msg + "New energy gain: %0.2f" % E2 + " MeV/c\n\n"
|
||||
log_msg = log_msg + " A1 A2 P1 P2 \n"
|
||||
log_msg = "Old energy gain: %0.2f" % dE1 + " MeV/c\n"
|
||||
log_msg = log_msg + "New energy gain: %0.2f" % dE2 + " MeV/c\n\n"
|
||||
log_msg = log_msg + " AmpScale1 AmpScale2 PwrScale1 PwrScale2 Acc-Volt1 Acc-Volt2 VSA1 VSA2 Power1 Power2\n"
|
||||
for station in stationlist:
|
||||
log_msg = log_msg + station + "%10.2f%10.2f%10.6f%10.6f" % (A1[station],A2[station],P1[station],P2[station]) + " \n"
|
||||
log_msg = log_msg + station + "%12.2f%12.2f%12.6f%12.6f%12.2f%12.2f%12.4f%12.4f%12.2f%12.2f" % (A1[station],A2[station],P1[station],P2[station],ACC1[station],ACC2[station],VSA1[station],VSA2[station],PWR1[station],PWR2[station]) + "\n"
|
||||
attachments = None
|
||||
elog(title, log_msg)
|
||||
|
||||
Executable → Regular
+5
-2
@@ -12,6 +12,7 @@ if is_panel:
|
||||
nb = int(args[3])
|
||||
lat = args[4]
|
||||
plt = args[5]
|
||||
bunch = args[6]
|
||||
else:
|
||||
start = -10.0
|
||||
stop = 150.0
|
||||
@@ -19,6 +20,7 @@ else:
|
||||
nb = 1
|
||||
lat = 0.110 # lat is applied after each step (but not between samples)
|
||||
plt = plot(None, title="Output")[0]
|
||||
bunch = 1
|
||||
|
||||
#Plot setup
|
||||
plt.clear()
|
||||
@@ -26,7 +28,7 @@ plt.removeMarker(None)
|
||||
plt.setStyle(plt.Style.ErrorY)
|
||||
plt.addSeries(LinePlotErrorSeries("Charge", Color.red))
|
||||
plt.getAxis(plt.AxisId.X).setLabel("Gun Beam Phase (deg)")
|
||||
plt.getAxis(plt.AxisId.Y).setLabel("SINEG01-DICT215:B1_CHARGE (pC)")
|
||||
plt.getAxis(plt.AxisId.Y).setLabel("Bunch Charge (pC)")
|
||||
plt.setLegendVisible(True)
|
||||
|
||||
if dry_run:
|
||||
@@ -38,7 +40,7 @@ if dry_run:
|
||||
else:
|
||||
bph = Positioner("Beam phase", "SINEG01-RSYS:SET-BEAM-PHASE", "SINEG01-RSYS:GET-BEAM-PHASE")
|
||||
rph = ChannelDouble("RF phase", "SINEG01-RSYS:SET-VSUM-PHASE")
|
||||
q = ChannelDouble("Charge", "SINEG01-DICT215:B1_CHARGE")
|
||||
q = ChannelDouble("Charge", "SINEG01-DICT215:B" + str(bunch) + "_CHARGE")
|
||||
q.initialize()
|
||||
q.monitored=True
|
||||
|
||||
@@ -49,6 +51,7 @@ bph.config.resolution = 0.5 # set and get have to be within resolution
|
||||
bph.config.rotation = True # will go back to zero if > 360 deg
|
||||
bph.config.save()
|
||||
bph.initialize()
|
||||
bph.update()
|
||||
bph0 = bph.read() % 360.0
|
||||
rph.initialize()
|
||||
rph.monitored=True
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# TDS calibration from phase jitter, to be completed...
|
||||
run('Tools/CameraCorrelation')
|
||||
start_camera_correlation("SATMA02-RLLE-DSP:PHASE-VS",
|
||||
"SATBD02-DSCR050_sp1 x_center_of_mass",
|
||||
samples = 200, modulo = 10, offset = 0, plt = plot(None)[0])
|
||||
while True:
|
||||
# the loop should run until the value is stable or a timeout is reached
|
||||
a = linear_fit.read()
|
||||
b = correlation.read()
|
||||
stop_camera_correlation()
|
||||
MO_FREQ = 142.8e6 # MO = 142.8 MHz
|
||||
calib = a * 360 * 84 * MO_FREQ / 1e15 # um/fs
|
||||
print(calib)
|
||||
@@ -11,11 +11,15 @@ if is_panel:
|
||||
bpm_ch = args[1]
|
||||
bpm_field = args[2]
|
||||
else:
|
||||
#station = "SATCB01"
|
||||
#bpm_ch = "SATBD02-DBPM010"
|
||||
station = "STEST01"
|
||||
bpm_ch = "SINBC02-DBPM140"
|
||||
bpm_field = "X1"
|
||||
station = "SATCB01"
|
||||
bpm_ch = "SATBD02-DBPM010"
|
||||
bpm_field = "Y2"
|
||||
#station = "S30CB13"
|
||||
#bpm_ch = "SARCL02-DBPM110"
|
||||
#bpm_field = "X1"
|
||||
#station = "STEST01"
|
||||
#bpm_ch = "SINBC02-DBPM140"
|
||||
#bpm_field = "X1"
|
||||
start = caget(station + "-RSYS:SET-SCAN-START")
|
||||
stop = caget(station + "-RSYS:SET-SCAN-STOP")
|
||||
step = caget(station + "-RSYS:SET-SCAN-STEP")
|
||||
@@ -78,7 +82,7 @@ def after(rec):
|
||||
#scan and plot
|
||||
try:
|
||||
phase.write(start)
|
||||
time.sleep(2.0)
|
||||
time.sleep(5.0)
|
||||
x_averager = create_averager(x, nb, lat)
|
||||
r = lscan(phase, x_averager, start, stop, step, latency=lat, after_read = after)
|
||||
rf_phase = r.getPositions(0)
|
||||
|
||||
Executable → Regular
+4
-3
@@ -1,3 +1,4 @@
|
||||
# change V-sum offset base globally (for example to compensate a laser delay change), dph is the desired phase shift
|
||||
dph = 34.0
|
||||
|
||||
stationlist0 = ("SINSB01","SINSB02","SINSB03","SINSB04","SINXB01")
|
||||
@@ -9,9 +10,9 @@ stationlist = stationlist1 + stationlist2 + stationlist3
|
||||
Ph = {}
|
||||
for station in stationlist:
|
||||
ph0 = caget(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE") # deg
|
||||
Ph[station] = ph0 - dph
|
||||
Ph[station] = (ph0 - dph) % 360
|
||||
|
||||
for station in stationlist:
|
||||
#caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", Ph[station])
|
||||
print(Ph[station])
|
||||
caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", Ph[station])
|
||||
print(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", Ph[station])
|
||||
|
||||
|
||||
Executable → Regular
+3
-3
@@ -1,11 +1,11 @@
|
||||
scan_range = 80.0
|
||||
# set scan parameters globally for the qt phasing tool
|
||||
scan_range = 100.0
|
||||
nb_steps = 21
|
||||
|
||||
|
||||
#stationlist = ("SINSB01","SINSB02","SINSB03","SINSB04","SINXB01")
|
||||
#stationlist = ("S10CB01","S10CB02","S10CB03","S10CB04","S10CB05","S10CB06","S10CB07","S10CB08","S10CB09")
|
||||
#stationlist = ("S20CB01","S20CB02","S20CB03","S20CB04")
|
||||
stationlist = ("S20CB01","S20CB02","S20CB03","S20CB04","S30CB01","S30CB02","S30CB03","S30CB04","S30CB05","S30CB06","S30CB07","S30CB08","S30CB09","S30CB10","S30CB11","S30CB12","S30CB13")
|
||||
stationlist = ("S30CB01","S30CB02","S30CB03","S30CB04","S30CB05","S30CB06","S30CB07","S30CB08","S30CB09","S30CB10","S30CB11","S30CB12","S30CB13")
|
||||
|
||||
P1, P2 = {}, {}
|
||||
for station in stationlist:
|
||||
|
||||
Reference in New Issue
Block a user