Closedown
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#Tue Aug 15 10:08:21 CEST 2017
|
||||
#Tue Aug 15 15:35:39 CEST 2017
|
||||
maxValue=180.0
|
||||
minValue=-180.0
|
||||
offset=0.0
|
||||
precision=3
|
||||
resolution=0.01
|
||||
resolution=0.1
|
||||
rotation=false
|
||||
scale=1.0
|
||||
unit=deg
|
||||
|
||||
@@ -48,8 +48,8 @@ else:
|
||||
phase.config.minValue = -180.0
|
||||
phase.config.maxValue = 180.0
|
||||
phase.config.precision = 3
|
||||
phase.config.resolution = 0.01
|
||||
phase.config.rotation = True
|
||||
phase.config.resolution = 0.1
|
||||
phase.config.rotation = False
|
||||
phase.config.save()
|
||||
phase.initialize()
|
||||
phase0 = phase.read()
|
||||
@@ -87,17 +87,13 @@ finally:
|
||||
phase.close()
|
||||
camtool.stop() # stops camtool but does not close it camtool is a global object
|
||||
|
||||
#Saving metadata
|
||||
ph = r.getPositions(0)
|
||||
p = [A * val.mean + B for val in r.getReadable(0)]
|
||||
dp = [abs(A) * val.mean for val in r.getReadable(1)]
|
||||
save_dataset(get_exec_pars().group + "/p", p)
|
||||
save_dataset(get_exec_pars().group + "/dp", dp)
|
||||
|
||||
try:
|
||||
plt.addSeries(LinePlotErrorSeries("Momentum Fit", plt.getSeries(0).color))
|
||||
plt.addSeries(LinePlotErrorSeries("Momentum Spread Fit", plt.getSeries(1).color, 2))
|
||||
|
||||
i_max = p.index(max(p))
|
||||
i_min = dp.index(min(dp))
|
||||
min_i, max_i = max(i_max-5, 0), min(i_max+6, len(p))
|
||||
@@ -110,12 +106,21 @@ try:
|
||||
plt.getSeries(3).setData(ph_dp_fit, dp_fit)
|
||||
plt.getSeries(2).setPointsVisible(False)
|
||||
plt.getSeries(3).setPointsVisible(False)
|
||||
|
||||
plt.addMarker(ph_p_max, plt.AxisId.X, "%2.2f" % ph_p_max, plt.getSeries(0).color)
|
||||
plt.addMarker(ph_dp_min, plt.AxisId.X, "%2.2f" % ph_dp_min, plt.getSeries(1).color)
|
||||
except:
|
||||
raise Exception("Fit failure")
|
||||
|
||||
|
||||
#Saving metadata
|
||||
save_dataset(get_exec_pars().group + "/p", p)
|
||||
set_attribute(get_exec_pars().group + "/p", "ph_p_max", ph_p_max)
|
||||
set_attribute(get_exec_pars().group + "/p", "p_max", p_max)
|
||||
save_dataset(get_exec_pars().group + "/dp", dp)
|
||||
set_attribute(get_exec_pars().group + "/dp", "ph_dp_min", ph_dp_min)
|
||||
set_attribute(get_exec_pars().group + "/dp", "dp_min", dp_min)
|
||||
|
||||
|
||||
#Elog entry
|
||||
if do_elog:
|
||||
if get_option("Generated data file:\n" + get_exec_pars().path +"\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
|
||||
Reference in New Issue
Block a user