Closedown
This commit is contained in:
@@ -14,6 +14,11 @@ if Scienta.acquisitionMode != Scienta.AcquisitionMode.Swept:
|
||||
Scienta.acquisitionMode = Scienta.AcquisitionMode.Swept
|
||||
ret=[]
|
||||
|
||||
adjusted_ranges = []
|
||||
for cur_range in range(len(ranges)):
|
||||
r = ranges[cur_range]
|
||||
ar = [round(r.min / r.vars[1]) * r.vars[1], round(r.max / r.vars[1]) * r.vars[1]]
|
||||
adjusted_ranges.append(ar)
|
||||
|
||||
set_exec_pars(open = True)
|
||||
|
||||
@@ -27,18 +32,18 @@ for i in range(len(ranges)):
|
||||
plots = plot(None, names)
|
||||
|
||||
for p in plots:
|
||||
eb_axis = NumberAxis("Binding energy")
|
||||
p.getAxis(p.AxisId.X).label = "kinetic energy"
|
||||
eb_axis = NumberAxis("binding energy")
|
||||
eb_axis.inverted = True
|
||||
jf = p.chart.plot
|
||||
jf.setDomainAxis(1, eb_axis)
|
||||
jf.getDomainAxis(1).labelPaint = jf.getDomainAxis(0).labelPaint
|
||||
jf.getDomainAxis(1).labelFont = jf.getDomainAxis(0).labelFont
|
||||
jf.getDomainAxis(1).tickLabelPaint = jf.getDomainAxis(0).tickLabelPaint
|
||||
jf.getDomainAxis(1).tickLabelFont = jf.getDomainAxis(0).tickLabelFont
|
||||
|
||||
#spectrum_eb_axis = NumberAxis("Binding energy")
|
||||
#spectrum_eb_axis.inverted = True
|
||||
#p = plots[0]
|
||||
#jf = p.chart.plot
|
||||
#jf.setDomainAxis(1, spectrum_eb_axis)
|
||||
#jf.getDomainAxis(1)
|
||||
#p.getAxis(p.AxisId.X).setRange(-2, 5)
|
||||
|
||||
# online spectrum
|
||||
|
||||
p = plots[0]
|
||||
spectrum_series = p.getSeries(0)
|
||||
@@ -59,12 +64,15 @@ def plot_cur_spectrum():
|
||||
print "Stopping spectrum plotting"
|
||||
task = None
|
||||
|
||||
|
||||
# measurements
|
||||
|
||||
try:
|
||||
for cur_range in range(len(ranges)):
|
||||
cur_iteration = 0
|
||||
skip_iteration = False
|
||||
Scienta.lowEnergy.write(ranges[cur_range].min)
|
||||
Scienta.highEnergy.write(ranges[cur_range].max)
|
||||
Scienta.lowEnergy.write(adjusted_ranges[cur_range][0])
|
||||
Scienta.highEnergy.write(adjusted_ranges[cur_range][1])
|
||||
Scienta.update()
|
||||
|
||||
vars = ranges[cur_range].vars
|
||||
@@ -99,10 +107,9 @@ try:
|
||||
xdata = Scienta.spectrumX
|
||||
p.getSeries(0).setData(xdata, ydata)
|
||||
eb_axis = p.chart.plot.getDomainAxis(1)
|
||||
dir(eb_axis)
|
||||
eb1 = Eph.take(100) - Scienta.lowEnergy.take(100) - 4.5
|
||||
eb2 = Eph.take(100) - Scienta.highEnergy.take(100) - 4.5
|
||||
spectrum_eb_axis.setRange(eb2, eb1)
|
||||
eb_axis.setRange(eb2, eb1)
|
||||
|
||||
if save_scienta_image:
|
||||
image_array = Scienta.dataMatrix.read()
|
||||
@@ -121,10 +128,10 @@ try:
|
||||
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, "Range Low", adjusted_ranges[cur_range][0])
|
||||
set_attribute(path, "Range High", adjusted_ranges[cur_range][1])
|
||||
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",])
|
||||
@@ -134,24 +141,6 @@ try:
|
||||
plots[cur_range+1].setTitle(str(ranges[cur_range]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
"""
|
||||
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)
|
||||
set_attribute(path, "Step Time",vars[0])
|
||||
set_attribute(path, "Step Size",vars[1])
|
||||
set_attribute(path, "Pass Energy",pass_energy)
|
||||
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:
|
||||
cur_range = -1
|
||||
|
||||
Reference in New Issue
Block a user