Closedown
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#Parameters (global variables):
|
||||
# ranges: list of RangeSelection havinf args = (step_size, step_time, iterations)
|
||||
# pass_energy
|
||||
# save_scienta_image
|
||||
#
|
||||
# skip_iteration: if set to 1 then skips after end of current iteration
|
||||
from ch.psi.pshell.data.LayoutDefault import ATTR_WRITABLE_DIMENSION as ATTR_WRITABLE_DIMENSION
|
||||
@@ -52,14 +53,16 @@ try:
|
||||
#iterations done in script
|
||||
xdata = None
|
||||
ydata = None
|
||||
image_data = None
|
||||
task = fork(plot_cur_spectrum)
|
||||
|
||||
|
||||
path="scan" + str(cur_range+1) + "/"
|
||||
for cur_iteration in range(vars[2]):
|
||||
plots[cur_range+1].setTitle(str(ranges[cur_range]) + " - iteration " + str(cur_iteration+1))
|
||||
while True:
|
||||
wait_beam()
|
||||
trig_scienta()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
if beam_ok:
|
||||
break
|
||||
if ydata is None:
|
||||
@@ -70,16 +73,41 @@ try:
|
||||
if xdata is None:
|
||||
xdata = Scienta.spectrumX
|
||||
plots[cur_range+1].getSeries(0).setData(xdata, ydata)
|
||||
if save_scienta_image:
|
||||
image_array = Scienta.dataMatrix.read()
|
||||
if image_data is None:
|
||||
image_data = image_array
|
||||
else:
|
||||
for k in range (len(image_data)):
|
||||
for j in range (len(image_data[0])):
|
||||
image_data[k][j] = image_data[k][j] + image_array[k][j]
|
||||
if skip_iteration:
|
||||
break
|
||||
save_dataset(path + "ScientaSpectrum", ydata)
|
||||
set_attribute(path, "Iterations",cur_iteration+1)
|
||||
if save_scienta_image:
|
||||
save_dataset(path + "ScientaImage", image_data)
|
||||
if cur_iteration==0:
|
||||
save_dataset(path + "ScientaChannels", xdata)
|
||||
set_attribute(path + "ScientaChannels", ATTR_WRITABLE_DIMENSION, 1)
|
||||
set_attribute(path, "Range Low", ranges[cur_range].min)
|
||||
set_attribute(path, "Range High", ranges[cur_range].max)
|
||||
set_attribute(path, "Step Time",vars[0])
|
||||
set_attribute(path, "Step Size",vars[1])
|
||||
set_attribute(path, "Pass Energy",pass_energy)
|
||||
set_attribute(path, "Readables", ["ScientaSpectrum","ScientaImage"] if save_scienta_image else ["ScientaSpectrum",])
|
||||
set_attribute(path, "Writables", ["ScientaChannels",])
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
|
||||
plots[cur_range+1].setTitle(str(ranges[cur_range]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
data1d = [1,2,3,4,5]
|
||||
path="scan" + str(cur_range+1) + "/"
|
||||
"""
|
||||
save_dataset(path + "ScientaSpectrum", ydata)
|
||||
save_dataset(path + "ScientaChannels", xdata)
|
||||
if save_scienta_image:
|
||||
save_dataset(path + "ScientaImage", image_data)
|
||||
set_attribute(path + "ScientaChannels", ATTR_WRITABLE_DIMENSION, 1)
|
||||
set_attribute(path, "Range Low", ranges[cur_range].min)
|
||||
set_attribute(path, "Range High", ranges[cur_range].max)
|
||||
@@ -89,9 +117,9 @@ try:
|
||||
set_attribute(path, "Iterations",cur_iteration+1)
|
||||
set_attribute(path, "Readables", ["ScientaSpectrum",])
|
||||
set_attribute(path, "Writables", ["ScientaChannels",])
|
||||
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
"""
|
||||
|
||||
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user