This commit is contained in:
gobbo_a
2018-01-17 14:16:08 +01:00
parent 84ba6b2878
commit 8d18ec8059
18 changed files with 4638 additions and 42 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#Fri Dec 08 14:08:46 CET 2017
#Tue Dec 19 08:09:06 CET 2017
maxValue=360.0
minValue=-360.0
offset=0.0
+11 -11
View File
@@ -1,19 +1,19 @@
#Thu Dec 14 13:16:37 CET 2017
#Wed Jan 17 12:03:42 CET 2018
\u0000\u0000\u0000\u0000=
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
colormap=Flame
colormapAutomatic=true
colormapMax=2098.0
colormapMin=0.0
colormapMax=9280.0
colormapMin=77.0
flipHorizontally=false
flipVertically=false
grayscale=false
imageHeight=2160
imageWidth=2560
imageHeight=494
imageWidth=659
invert=false
regionStartX=1
regionStartY=1
regionStartX=0
regionStartY=0
rescaleFactor=1.0
rescaleOffset=0.0
roiHeight=-1
@@ -25,9 +25,9 @@ rotationCrop=false
scale=1.0
serverURL=localhost\:10000
spat=
spatialCalOffsetX=-152.54092616500228
spatialCalOffsetY=-487.4298187797324
spatialCalScaleX=-8.737659603675489
spatialCalScaleY=-8.834898016879965
spatialCalOffsetX=-50.03909304143862
spatialCalOffsetY=-50.048875855327466
spatialCalScaleX=-1.0
spatialCalScaleY=-1.0
spatialCalUnits=null
transpose=false
+1 -1
View File
@@ -1,4 +1,4 @@
#Thu Dec 14 08:06:46 CET 2017
#Wed Dec 20 15:55:53 CET 2017
colormap=Flame
colormapAutomatic=true
colormapMax=NaN
+5 -5
View File
@@ -1,4 +1,4 @@
#Mon Dec 04 09:46:10 CET 2017
#Mon Dec 18 11:29:15 CET 2017
colormap=Flame
colormapAutomatic=true
colormapMax=NaN
@@ -16,9 +16,9 @@ roiY=0
rotation=0.0
rotationCrop=false
scale=1.0
spatialCalOffsetX=-391.48331413428485
spatialCalOffsetY=-387.5330483081544
spatialCalScaleX=-26.714159311263906
spatialCalScaleY=-27.10027117768595
spatialCalOffsetX=-50.03909304143862
spatialCalOffsetY=-50.048875855327466
spatialCalScaleX=-1.0
spatialCalScaleY=-1.0
spatialCalUnits=mm
transpose=false
+1 -1
View File
@@ -553,7 +553,7 @@ public class ScreenPanel extends Panel {
void manageFit(BufferedImage bi, Data data) {
Overlay[][] fo = null;
if ((showFit && showProfile)){
if ((showFit || showProfile)){
try{
fo=getFitOverlays(data);
} catch (Exception ex){
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

+33 -15
View File
@@ -16,7 +16,7 @@ step = caget(station + "-RSYS:SET-SCAN-STEP")
lat = caget(station + "-RSYS:SET-SCAN-WAIT-TIME")
nb = caget(station + "-RSYS:SET-NUM-AVERAGE")
disp = caget(bpm_ch + ":DISPERSION")
energy0 = caget(bpm_ch + ":ENERGY")
energy0 = caget(bpm_ch + ":ENERGY-OP")
A = energy0 / disp / 1e3
B = energy0
phase = Positioner("Phase", station + "-RSYS:SET-VSUM-PHASE", station + "-RSYS:GET-VSUM-PHASE")
@@ -67,16 +67,16 @@ try:
(fit_amplitude, fit_phase_deg, fit_offset, ph_crest, fit_x, fit_y) = hfitoff(energy , rf_phase)
except:
raise Exception("Fit failure")
plt = plot(None,name="phase scan")[0]
# This only works when pshell is visible not in server mode to be fixed
if plt is not None:
plt.getSeries(0).setData(to_array(rf_phase,'d'), to_array(energy,'d'))
plt.getSeries(0).setPointSize(6)
plt.getSeries(0).setLinesVisible(False)
plt.addSeries(LinePlotSeries("fit"))
plt.getSeries(1).setData(fit_x, fit_y)
plt.getSeries(1).setPointsVisible(False)
plt.setLegendVisible(True)
# plt = plot(None,name="phase scan")[0]
# # This only works when pshell is visible not in server mode to be fixed
# if plt is not None:
# plt.getSeries(0).setData(to_array(rf_phase,'d'), to_array(energy,'d'))
# plt.getSeries(0).setPointSize(6)
# plt.getSeries(0).setLinesVisible(False)
# plt.addSeries(LinePlotSeries("fit"))
# plt.getSeries(1).setData(fit_x, fit_y)
# plt.getSeries(1).setPointsVisible(False)
# plt.setLegendVisible(True)
phase.write(ph_crest)
time.sleep(lat)
Ampl = V.read()
@@ -93,14 +93,32 @@ finally:
V.close()
P.close()
x.close()
#phase_corr = caget(station + "-RSYS:GET-VSUM-PHASE-OFFSET-CORR")
#phase_offset = 90.0 - ph_crest - phase_corr
phase_offset = 90.0 - ph_crest
phase_corr = caget(station + "-RSYS:GET-VSUM-PHASE-OFFSET-CORR")
phase_offset = 90.0 - ph_crest - phase_corr
amplitude_scale = fit_amplitude / Ampl
power_scale = Power / fit_amplitude**2 if fit_amplitude != 0 else 0.0
caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE-CALC", phase_offset)
caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE-CALC", amplitude_scale)
caput(station + "-RSYS:SET-VOLT-POWER-SCALE-CALC", power_scale)
#Saving metadata
save_dataset (get_exec_pars().group + "/Station" , station )
save_dataset (get_exec_pars().group + "/Energy" , energy )
save_dataset (get_exec_pars().group + "/Energy gain" , fit_amplitude )
save_dataset (get_exec_pars().group + "/On-crest VS-phase" , ph_crest )
save_dataset (get_exec_pars().group + "/VS-phase offset" , phase_offset )
save_dataset (get_exec_pars().group + "/Amplitude scale" , amplitude_scale )
save_dataset (get_exec_pars().group + "/Power scale" , power_scale )
set_attribute(get_exec_pars().group + "/Energy" , "Unit", "MeV" )
set_attribute(get_exec_pars().group + "/Energy gain" , "Unit", "MeV" )
set_attribute(get_exec_pars().group + "/On-crest VS-phase" , "Unit", "deg" )
set_attribute(get_exec_pars().group + "/VS-phase offset" , "Unit", "deg" )
set_attribute(get_exec_pars().group + "/Amplitude scale" , "Unit", "MV" )
set_attribute(get_exec_pars().group + "/Power scale" , "Unit", "MW/MV^2" )
set_attribute(get_exec_pars().group + "/Phase" , "Unit", "deg" )
set_attribute(get_exec_pars().group + "/BPM-X averager" , "Unit", "mm" )
#Elog entry
if do_elog:
title = "Phase scan" + station
log_msg = "Data file: " + get_exec_pars().path + "\n"
@@ -108,6 +126,6 @@ if do_elog:
log_msg = log_msg + "Energy gain: %0.3f" % fit_amplitude + " MeV \n"
log_msg = log_msg + "VS-phase offset: %0.2f" % phase_offset + " deg \n"
log_msg = log_msg + "Amplitude scale: %0.3f" % amplitude_scale + " MV \n"
log_msg = log_msg + "Power scale: %0.3f" % power_scale + " MW/MV^2"
log_msg = log_msg + "Power scale: %0.6f" % power_scale + " MW/MV^2"
attachments = get_plot_snapshots()
elog(title, log_msg, attachments)
+6 -5
View File
@@ -63,7 +63,7 @@ def _append_frame(paths, stream_value, index, data_type, shape):
print id, val
traceback.print_exc()
print "Saved frame: ", index
#print "Saved frame: ", index
def _write_metadata(paths, camera, images, interval):
@@ -94,7 +94,7 @@ def save_camera_data(server, images = 1, interval = -1, root = "/camera1", paral
server.paused = True
try:
for i in range(images):
print i
#print i
if i==0:
_create_tables(paths, stream_value, data_type, shape, images)
_write_metadata(paths, camera, images, interval)
@@ -115,10 +115,11 @@ def save_camera_data(server, images = 1, interval = -1, root = "/camera1", paral
if pause:
server.paused = False
pass
print "Waiting finish persisting..."
data_file = get_exec_pars().path
#print "Waiting finish : ", data_file
join(tasks)
print "Done"
#print "Done"
return data_file
def save_camera_snapshot(server, file, format = "png"):
ImageBuffer.saveImage(server.output, file, "png")
+1 -3
View File
@@ -75,10 +75,8 @@ try:
else:
_server.waitNext(10000)
save_camera_data(_server, images, interval, parallel = True, pause=True)
data_file = save_camera_data(_server, images, interval, parallel = True, pause=True)
set_exec_pars(open = False)
data_file = get_exec_pars().path
if snapshot:
format ="png"
+3
View File
@@ -0,0 +1,3 @@
plot([1,2,3,4,5,4,3,2,1], "test")
attachments = get_plot_snapshots()
print attachments