Version 1.14
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
#Fri Feb 07 11:46:23 CET 2020
|
||||
FileSequentialNumber=1251
|
||||
#Mon Aug 03 14:24:23 CEST 2020
|
||||
FileSequentialNumber=2478
|
||||
|
||||
@@ -1,41 +1,44 @@
|
||||
#Fri Feb 07 11:39:15 CET 2020
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000=
|
||||
\u0000=
|
||||
#Thu Aug 13 08:13:01 CEST 2020
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
spatialCalOffsetY=-50.048875855327466
|
||||
spatialCalOffsetX=-50.03909304143862
|
||||
\u0000=
|
||||
\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000=
|
||||
colormapLogarithmic=false
|
||||
scale=1.0
|
||||
grayscale=false
|
||||
spatialCalScaleX=-1.0
|
||||
spatialCalScaleY=-1.0
|
||||
serverURL=null
|
||||
colormapMax=6283.0
|
||||
rescaleOffset=0.0
|
||||
roiWidth=-1
|
||||
colormap=Flame
|
||||
imageWidth=1744
|
||||
imageWidth=2560
|
||||
invert=false
|
||||
spat=
|
||||
colormapMin=46.0
|
||||
colormapMin=814.0
|
||||
rotationCrop=false
|
||||
rotation=0.0
|
||||
rescaleFactor=1.0
|
||||
imageHeight=1680
|
||||
spatialCalUnits=null
|
||||
flipVertically=false
|
||||
r=
|
||||
roiHeight=-1
|
||||
t=
|
||||
flipHorizontally=false
|
||||
colormapAutomatic=true
|
||||
roiY=0
|
||||
roiX=0
|
||||
spatialCalOffsetY=-50.048780487804876
|
||||
spatialCalOffsetX=-50.03903200624512
|
||||
scale=1.0
|
||||
regionStart=
|
||||
grayscale=false
|
||||
colormapMax=3092.0
|
||||
spat=
|
||||
rotation=0.0
|
||||
rescaleFactor=1.0
|
||||
imageHeight=2160
|
||||
spatialCalUnits=null
|
||||
flipVertically=false
|
||||
r=
|
||||
t=
|
||||
flipHorizontally=false
|
||||
transpose=false
|
||||
regionStartX=433
|
||||
regionStartY=241
|
||||
regionStartX=1
|
||||
regionStartY=1
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#Sat Jan 25 10:00:39 CET 2020
|
||||
spatialCalOffsetY=-283.472459616368
|
||||
spatialCalOffsetX=-508.635792340687
|
||||
#Tue May 12 17:41:26 CEST 2020
|
||||
spatialCalOffsetY=-371.75254447653117
|
||||
spatialCalOffsetX=-371.5638424602207
|
||||
colormapLogarithmic=false
|
||||
scale=1.0
|
||||
grayscale=false
|
||||
spatialCalScaleX=-11.968979779411764
|
||||
spatialCalScaleY=-10.638298123826168
|
||||
colormapMax=45095.0
|
||||
spatialCalScaleX=-11.494253419452887
|
||||
spatialCalScaleY=-11.494253533848884
|
||||
colormapMax=1000.0
|
||||
rescaleOffset=0.0
|
||||
roiWidth=-1
|
||||
colormap=Flame
|
||||
imageWidth=659
|
||||
invert=false
|
||||
colormapMin=74.0
|
||||
colormapMin=0.0
|
||||
rotationCrop=false
|
||||
rotation=0.0
|
||||
rescaleFactor=1.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Tue Feb 04 11:46:29 CET 2020
|
||||
#Tue Apr 28 11:13:53 CEST 2020
|
||||
offset=0.0
|
||||
maxValue=51500.0
|
||||
precision=1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Thu Feb 06 15:36:29 CET 2020
|
||||
#Mon May 04 11:45:54 CEST 2020
|
||||
spatialCalOffsetY=-820.4883730911062
|
||||
spatialCalOffsetX=-861.4939970777481
|
||||
colormapLogarithmic=false
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
#Fri Jul 21 15:08:25 CEST 2017
|
||||
flipHorizontally=false
|
||||
flipVertically=false
|
||||
grayscale=true
|
||||
invert=true
|
||||
rescaleFactor=1.0
|
||||
rescaleOffset=0.0
|
||||
roiHeight=-1
|
||||
roiWidth=-1
|
||||
roiX=0
|
||||
roiY=0
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
scale=1.0
|
||||
spatialCalOffsetX=NaN
|
||||
#Fri Jun 05 14:13:17 CEST 2020
|
||||
spatialCalOffsetY=NaN
|
||||
spatialCalOffsetX=NaN
|
||||
colormapLogarithmic=false
|
||||
scale=1.0
|
||||
grayscale=true
|
||||
spatialCalScaleX=NaN
|
||||
spatialCalScaleY=NaN
|
||||
colormapMax=NaN
|
||||
rescaleOffset=0.0
|
||||
roiWidth=-1
|
||||
colormap=null
|
||||
invert=true
|
||||
colormapMin=NaN
|
||||
rotation=0.0
|
||||
rotationCrop=false
|
||||
rescaleFactor=1.0
|
||||
spatialCalUnits=mm
|
||||
flipVertically=false
|
||||
roiHeight=-1
|
||||
flipHorizontally=false
|
||||
colormapAutomatic=false
|
||||
roiY=0
|
||||
roiX=0
|
||||
transpose=false
|
||||
|
||||
@@ -2297,10 +2297,10 @@ public class ScreenPanel6 extends Panel {
|
||||
System.out.println("Setting laser state: " + value + " - bunch" + bunch);
|
||||
//Epics.putq("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", value ? 0 : 1);
|
||||
if ((bunch<=0) || (bunch==1)){
|
||||
Epics.putq("SWISSFEL-STATUS:Bunch-1-OnDelay-Sel", value ? 0 : 1);
|
||||
Epics.putq("SIN-TIMAST-TMA:Bunch-1-OnDelay-Sel", value ? 0 : 1);
|
||||
}
|
||||
if ((bunch<=0) || (bunch==2)){
|
||||
Epics.putq("SWISSFEL-STATUS:Bunch-2-OnDelay-Sel", value ? 0 : 1);
|
||||
Epics.putq("SIN-TIMAST-TMA:Bunch-2-OnDelay-Sel", value ? 0 : 1);
|
||||
}
|
||||
|
||||
Epics.putq("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC", 1);
|
||||
@@ -4269,6 +4269,9 @@ public class ScreenPanel6 extends Panel {
|
||||
if (ret == OptionResult.No) {
|
||||
laserOn2= false;
|
||||
}
|
||||
if (ret == OptionResult.Cancel) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ret = SwingUtils.showOption(getTopLevel(), "Capture Background", "Do you want to capture background now?", OptionType.OkCancel);
|
||||
|
||||
@@ -318,6 +318,7 @@ def stop_blm_ws(blm):
|
||||
caput(blm + ":WS_STOP.PROC", 1)
|
||||
|
||||
def set_blm_ws_gain(blm, gain):
|
||||
print "set_blm_ws_gain ", blm, gain
|
||||
caput(blm + ":WS_PMT_GAIN_VOLTS", float(gain))
|
||||
|
||||
def get_blm_ws_gain(blm):
|
||||
@@ -325,6 +326,7 @@ def get_blm_ws_gain(blm):
|
||||
|
||||
|
||||
def set_blm_ws_att(blm, att):
|
||||
print "set_blm_ws_att ", blm, gain
|
||||
caput(blm + ":WS_PMT_ATT_VOLTS", att)
|
||||
|
||||
def get_blm_ws_att(blm):
|
||||
|
||||
@@ -41,8 +41,8 @@ plt.setLegendVisible(True)
|
||||
|
||||
def plot_point(record, scan):
|
||||
global plt
|
||||
q_mean, q_stdev = record.values[0].mean, record.values[0].stdev
|
||||
V_mean, V_stdev = record.values[1].mean, record.values[1].stdev
|
||||
q_mean, q_stdev = record.readables[0].mean, record.readables[0].stdev
|
||||
V_mean, V_stdev = record.readables[1].mean, record.readables[1].stdev
|
||||
plt.getSeries(0).appendData(record.positions[0], q_mean, q_stdev)
|
||||
plt.getSeries(1).appendData(record.positions[0], V_mean, V_stdev)
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
|
||||
|
||||
dry_run = False
|
||||
do_elog = True
|
||||
base_name = "SATBD02-DICT499" # SINEG01-DICT009 S10DI01-DICT113 SARMA01-DICT482 SARBD01-DICT599
|
||||
dev_name = "SATBD02-DICT020" # SINEG01-DICT215 S10DI01-DICT025 SARMA01-DICT090 SARBD01-DICT030
|
||||
base_name = "SINEG01-DICT009" # SINEG01-DICT009 S10DI01-DICT113 SARMA01-DICT482 SARBD01-DICT599
|
||||
dev_name = "SINEG01-DICT215" # SINEG01-DICT215 S10DI01-DICT025 SARMA01-DICT090 SARBD01-DICT030
|
||||
|
||||
if dry_run:
|
||||
t = ChannelDouble("fine delay (us)", "SINEG01-DICT215:Pul1-Delay-SP-SIM")
|
||||
@@ -20,8 +20,8 @@ V.initialize()
|
||||
|
||||
t0 = t.read()
|
||||
|
||||
start = 1001.000
|
||||
stop = 1002.200
|
||||
start = 1000.000
|
||||
stop = 1001.200
|
||||
step = 0.01
|
||||
nb = 5
|
||||
lat = 0.150
|
||||
@@ -40,13 +40,13 @@ plt.setLegendVisible(True)
|
||||
def plot_point(record, scan):
|
||||
global plt
|
||||
q_mean, q_stdev = record.values[0].mean, record.values[0].stdev
|
||||
V_mean, V_stdev = record.values[1].mean, record.values[1].stdev
|
||||
V_mean, V_stdev = record.values[1].mean, recFd.values[1].stdev
|
||||
plt.getSeries(0).appendData(record.positions[0], q_mean, q_stdev)
|
||||
plt.getSeries(1).appendData(record.positions[0], V_mean, V_stdev)
|
||||
|
||||
try:
|
||||
q_averager = create_averager(q, nb, lat)
|
||||
V_averager = create_averager(V, nb, lat)
|
||||
V_averager = create_averager(V,F nb, lat)
|
||||
V_averager.monitored=True
|
||||
r = lscan(t, (q_averager, V_averager), start, stop, step, latency=lat, after_read = plot_point)
|
||||
delay = r.getPositions(0)
|
||||
|
||||
@@ -38,7 +38,7 @@ INCREMENT_FACTOR = 0.5
|
||||
SCAN_RANGE_FACTOR = 6
|
||||
MAX_RANGE_STEP = 300
|
||||
|
||||
SET_BLM_WS_MODE = False
|
||||
SET_BLM_WS_MODE = True
|
||||
SET_BLM_WS_SETTLING_TIME = 2.0
|
||||
SET_BLM_WS_BS_READBACK_TIMEOUT = 10000 #ms
|
||||
|
||||
@@ -234,8 +234,8 @@ def do_scan(index):
|
||||
else:
|
||||
plt.getAxis(plt.AxisId.X).setRange(scan_range[2], scan_range[3])
|
||||
|
||||
|
||||
set_blm_gain(scan_type, index)
|
||||
if adaptive>0:
|
||||
set_blm_gain(scan_type, index)
|
||||
|
||||
scanner.init(wait=True)
|
||||
scanner.curr_cycl.write(0)
|
||||
@@ -474,7 +474,8 @@ finally:
|
||||
except:
|
||||
pass
|
||||
if SET_BLM_WS_MODE and len(blms)>0:
|
||||
stop_blm_ws(blms[0])
|
||||
for i in range(len(blms)):
|
||||
stop_blm_ws(blms[i])
|
||||
print "Closing scanner"
|
||||
scanner.close()
|
||||
print "Closing stream"
|
||||
|
||||
@@ -73,7 +73,7 @@ def after(rec):
|
||||
#scan and plot
|
||||
try:
|
||||
phase.write(start)
|
||||
time.sleep(1.0)
|
||||
time.sleep(2.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)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
E1 = 3722.0 # old energy
|
||||
E2 = 3789.0 # new energy
|
||||
E1 = 3493.0 # old energy
|
||||
E2 = 3752.0 # new energy
|
||||
|
||||
do_elog = True
|
||||
|
||||
#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 = ("S20CB01","S20CB02","S20CB03","S20CB04","S30CB01","S30CB02","S30CB03","S30CB04","S30CB05","S30CB06","S30CB07","S30CB08","S30CB09","S30CB10","S30CB11","S30CB12","S30CB13")
|
||||
#stationlist = ("S20CB01","S20CB02","S20CB03","S20CB04","S30CB01","S30CB02","S30CB03","S30CB04","S30CB05","S30CB06","S30CB07","S30CB08","S30CB09","S30CB10","S30CB11","S30CB12","S30CB13")
|
||||
|
||||
A1, A2 = {}, {}
|
||||
P1, P2 = {}, {}
|
||||
@@ -16,16 +17,12 @@ for station in stationlist:
|
||||
A2[station] = A * E2 / E1
|
||||
P1[station] = P
|
||||
P2[station] = P * (E1 / E2)**2
|
||||
# set RF on-delay
|
||||
caput("SIN-TIMAST-TMA:Beam-RF-Delay-Sel",1)
|
||||
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC",1)
|
||||
|
||||
for station in stationlist:
|
||||
caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", A2[station])
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE", P2[station])
|
||||
caput(station + "-RSYS:CMD-LOAD-CALIB-BEAM", 1)
|
||||
# set RF on-beam
|
||||
caput("SIN-TIMAST-TMA:Beam-RF-Delay-Sel",0)
|
||||
caput("SIN-TIMAST-TMA:Beam-Apply-Cmd.PROC",1)
|
||||
|
||||
#Elog entry
|
||||
if do_elog:
|
||||
title = "Energy calibration scaling"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Eph1 = 11.312 # actual photon energy
|
||||
Eph2 = 12.00 # desired photon energy
|
||||
Eph1 = 11.65 # actual photon energy
|
||||
Eph2 = 12.05 # desired photon energy
|
||||
|
||||
do_elog = True
|
||||
|
||||
@@ -11,9 +11,6 @@ for und in undlist:
|
||||
K1[und] = K
|
||||
K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5
|
||||
print K1,K2
|
||||
#if Eph2 > Eph1 :
|
||||
# for und in undlist: caput(und + "-UIND030:K_SET", 1.1)
|
||||
# time.sleep(40.0)
|
||||
for und in undlist: caput(und + "-UIND030:K_SET", K2[und])
|
||||
|
||||
#Elog entry
|
||||
@@ -21,5 +18,4 @@ if do_elog:
|
||||
title = "Wavelength change"
|
||||
log_msg = "Old photon energy: %0.2f" % Eph1 + " kev\n"
|
||||
log_msg = log_msg + "New photon energy: %0.2f" % Eph2 + " keV\n"
|
||||
attachments = None
|
||||
elog(title, log_msg, attachments)
|
||||
elog(title, log_msg)
|
||||
38
script/Undulators/K-calc_AT.py
Normal file
38
script/Undulators/K-calc_AT.py
Normal file
@@ -0,0 +1,38 @@
|
||||
undlist = ("SATUN17","SATUN18","SATUN19","SATUN20","SATUN21","SATUN22")
|
||||
|
||||
### getting current photon energy:
|
||||
Eph1 = caget(undlist[0] + "-UIND030:FELPHOTENE")
|
||||
#Eph1 = 0.530 # actual photon energy in keV
|
||||
print("Photon energy at start (at ", undlist[0],") : ", round(Eph1,4))
|
||||
|
||||
### give desired photon energy via relative or absolute method.
|
||||
### please comment the other out!
|
||||
|
||||
### relative change in photon energy:
|
||||
#step = -0.002 # desired step to scale in keV
|
||||
#Eph2 = Eph1 + step
|
||||
|
||||
### absolute change in photon energy:
|
||||
Eph2 = 0.540 # desired photon energy in keV
|
||||
|
||||
print("Photon energy at end: ", round(Eph2,4))
|
||||
|
||||
do_elog = True
|
||||
|
||||
|
||||
### actual code:
|
||||
K1, K2 = {}, {}
|
||||
for und in undlist:
|
||||
K = caget(und + "-UIND030:K_SET")
|
||||
K1[und] = K
|
||||
K2[und] = ((Eph1 / Eph2 * (K**2 + 2) - 2))**0.5
|
||||
print(K1)
|
||||
print(K2)
|
||||
for und in undlist: caput(und + "-UIND030:K_SET", K2[und])
|
||||
|
||||
### create Elog entry
|
||||
if do_elog:
|
||||
title = "Athos wavelength change"
|
||||
log_msg = "Old photon energy: %0.4f" % Eph1 + " kev\n"
|
||||
log_msg = log_msg + "New photon energy: %0.4f" % Eph2 + " keV\n"
|
||||
elog(title, log_msg)
|
||||
@@ -292,6 +292,10 @@ def elog(title, message, attachments = [], application = None, author = None, ca
|
||||
if (err is not None) and err!="":
|
||||
raise Exception(err)
|
||||
print out
|
||||
import ch.psi.pshell.ui.App as App
|
||||
if not App.isOutputRedirected():
|
||||
import java.lang.System as System
|
||||
System.out.println(out)
|
||||
try:
|
||||
return int(out[out.find("ID=") +3 : ])
|
||||
except:
|
||||
|
||||
@@ -4,8 +4,8 @@ devlist = ['SARCL02-MCRX100:I-SET', 'SARCL02-MCRX120:I-SET', 'SARCL02-MCRX200:I-
|
||||
'SARCL02-MCRX320:I-SET', 'SARCL02-MCRX340:I-SET', 'SARCL02-MCRX450:I-SET' ]
|
||||
#SARCL02-MCRY120:I-SET, SARCL02-MCRY230:I-SET, SARCL02-MCRY240:I-SET, SARCL02-MCRY480:I-SET,
|
||||
#SARCL02-MCRY320:I-SET, SARCL02-MCRY340:I-SET, SARCL02-MCRY450:I-SET
|
||||
energy = 2840.0
|
||||
energynew = 3398.0
|
||||
energy = 4500.0
|
||||
energynew = 4040.0
|
||||
efactor = energynew / energy
|
||||
print(efactor)
|
||||
|
||||
|
||||
17
script/test/test_stream.py
Normal file
17
script/test/test_stream.py
Normal file
@@ -0,0 +1,17 @@
|
||||
#cam_server.stop()
|
||||
#cam_server.start("stream_example")
|
||||
cam_server.start("bs_timing_test")
|
||||
cam_server.stream.waitCacheChange(3000)
|
||||
|
||||
bscan (cam_server.stream, 100, save=False)
|
||||
|
||||
names=[]
|
||||
data=[]
|
||||
for k,v in cam_server.value.items():
|
||||
names.append(k)
|
||||
data.append(v)
|
||||
|
||||
plot(data, names)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user