Startup
This commit is contained in:
22
script/users/Granas/ManipulatorScan.py~
Normal file
22
script/users/Granas/ManipulatorScan.py~
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Arguments:
|
||||
|
||||
MOTOR (device)
|
||||
SENSORS (list)
|
||||
RANGE (tuple (min, max))
|
||||
STEPS (int or tuple)
|
||||
LATENCY (double)
|
||||
RELATIVE (BOOLEAN)
|
||||
"""
|
||||
|
||||
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
|
||||
adjust_sensors()
|
||||
set_adc_averaging()
|
||||
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
|
||||
|
||||
try:
|
||||
lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
|
||||
finally:
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
8
script/users/Granas/ManipulatorScanL_O1s.py
Normal file
8
script/users/Granas/ManipulatorScanL_O1s.py
Normal file
@@ -0,0 +1,8 @@
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
for i in range(5):
|
||||
mprint("___prepare O1s position "+str(i)+" measure___")
|
||||
pos_file = "pos_"+str(i)+".txt"
|
||||
copyFile(pearlU_path+"settings/",pos_file ,"actual_GE_pos.txt")
|
||||
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan_O1s.py")
|
||||
34
script/users/Granas/ManipulatorScan_base.py
Normal file
34
script/users/Granas/ManipulatorScan_base.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
changed by Christoph Setz
|
||||
|
||||
Arguments:
|
||||
|
||||
MOTOR (device)
|
||||
SENSORS (list)
|
||||
RANGE (tuple (min, max))
|
||||
STEPS (int or tuple)
|
||||
LATENCY (double)
|
||||
RELATIVE (BOOLEAN)
|
||||
"""
|
||||
|
||||
#set_preference(Preference.PLOT_TYPES,{'ImageIntegrator':1})
|
||||
adjust_sensors()
|
||||
set_adc_averaging()
|
||||
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
|
||||
|
||||
#MOTOR = dummy
|
||||
#RANGE = (0,10)
|
||||
#STEPS = 10 # set before
|
||||
"""
|
||||
MOTOR = ManipulatorZ
|
||||
RANGE = (113,120.5)
|
||||
RELATIVE = False
|
||||
"""
|
||||
|
||||
try:
|
||||
lscan(MOTOR, SENSORS, RANGE[0], RANGE[1], STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout)
|
||||
finally:
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
time.sleep(10)
|
||||
64
script/users/Granas/XPSSpectrum_OV.py
Normal file
64
script/users/Granas/XPSSpectrum_OV.py
Normal file
@@ -0,0 +1,64 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of Zn1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
|
||||
evalval = False
|
||||
mprint("___starting overview measure___")
|
||||
answer = raw_input('did you put the grating? (yes)')
|
||||
if "yes" not in answer.lower():
|
||||
print "do it "
|
||||
else:
|
||||
loadParameterset(pearlU_path+"settings/NE_actual_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/overview.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
evalval = True
|
||||
|
||||
ranges=[]
|
||||
|
||||
if len(range1) >5 and evalval:
|
||||
ranges.append((range1[0],range1[1],range1[2],range1[3],range1[4],int(round(range1[5]))))
|
||||
|
||||
# (eph, min, max, step, time, iter)
|
||||
#save_scienta_image = True
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
|
||||
pass_energy = 100
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
time.sleep(4)
|
||||
62
script/users/Granas/XPSSpectrum_Zn2p.py
Normal file
62
script/users/Granas/XPSSpectrum_Zn2p.py
Normal file
@@ -0,0 +1,62 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of Zn1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
mprint("___starting Zn2p measure___")
|
||||
|
||||
answer = raw_input('did you put the grating? (yes)')
|
||||
if "yes" not in answer.lower():
|
||||
print "do it "
|
||||
else:
|
||||
loadParameterset(pearlU_path+"settings/NE_actual_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/Zn2p.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
evalval = True
|
||||
ranges=[]
|
||||
|
||||
if len(range1) >5 and evalval:
|
||||
ranges.append((range1[0],range1[1],range1[2],range1[3],range1[4],int(round(range1[5]))))
|
||||
|
||||
# (eph, min, max, step, time, iter)
|
||||
#save_scienta_image = True
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
|
||||
pass_energy = 50
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
time.sleep(4)
|
||||
44
script/users/Granas/curved/ManipulatorScan_Zn2p.py
Normal file
44
script/users/Granas/curved/ManipulatorScan_Zn2p.py
Normal file
@@ -0,0 +1,44 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of C1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN, znsearchname
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
|
||||
mprint("___starting C1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/actual_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/"+znsearchname)
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
|
||||
if True:
|
||||
ranges = [range1]
|
||||
# (eph, min, max, step, time, iter)
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
STEPS = 5
|
||||
MOTOR = dummy
|
||||
RANGE = (0,10)
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
time.sleep(10)
|
||||
120
script/users/Granas/noUse/FeCrXPS.py
Normal file
120
script/users/Granas/noUse/FeCrXPS.py
Normal file
@@ -0,0 +1,120 @@
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
|
||||
from ch.psi.pshell.data.LayoutDefault import ATTR_WRITABLE_DIMENSION as ATTR_WRITABLE_DIMENSION
|
||||
|
||||
cur_range = 0
|
||||
cur_iteration = 0
|
||||
|
||||
Scienta.acquisitionMode = Scienta.AcquisitionMode.Swept
|
||||
ret=[]
|
||||
|
||||
set_exec_pars(open = True)
|
||||
|
||||
#Global arguments
|
||||
Scienta.passEnergy = pass_energy
|
||||
|
||||
names=[]
|
||||
names.append("Online Spectrum")
|
||||
for i in range(len(ranges)):
|
||||
names.append(str(ranges[i][0]))
|
||||
plots = plot(None, names)
|
||||
spectrum_series = plots[0].getSeries(0)
|
||||
def plot_cur_spectrum():
|
||||
global spectrum_series
|
||||
try:
|
||||
while get_context().state.running:
|
||||
y = Scienta.spectrum.take(100)
|
||||
x = Scienta.spectrumX
|
||||
spectrum_series.setData(x, y)
|
||||
time.sleep(1.0)
|
||||
finally:
|
||||
print "Stopping spectrum plotting"
|
||||
task = None
|
||||
|
||||
try:
|
||||
for cur_range in range(len(ranges)):
|
||||
cur_iteration = 0
|
||||
skip_iteration = False
|
||||
params = ranges[cur_range]
|
||||
Eph.move(params[0])
|
||||
time.sleep(5.0)
|
||||
Scienta.lowEnergy.write(params[1])
|
||||
Scienta.highEnergy.write(params[2])
|
||||
Scienta.update()
|
||||
|
||||
Scienta.stepSize.write(params[3])
|
||||
Scienta.stepTime.write(params[4])
|
||||
Scienta.setIterations(1)
|
||||
|
||||
set_adc_averaging()
|
||||
|
||||
#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(params[5]):
|
||||
plots[cur_range+1].setTitle(str(params[0]) + " - iteration " + str(cur_iteration+1))
|
||||
while True:
|
||||
wait_beam()
|
||||
trig_scienta()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
if beam_ok:
|
||||
break
|
||||
if ydata is None:
|
||||
ydata = spectrum_array
|
||||
else:
|
||||
for k in range (len(spectrum_array)):
|
||||
ydata[k] = ydata[k] + spectrum_array[k]
|
||||
if xdata is None:
|
||||
xdata = Scienta.spectrumX
|
||||
plots[cur_range+1].getSeries(0).setData(xdata, ydata)
|
||||
if skip_iteration:
|
||||
break
|
||||
save_dataset(path + "ScientaSpectrum", ydata)
|
||||
set_attribute(path, "Iterations",cur_iteration+1)
|
||||
if cur_iteration==0:
|
||||
save_dataset(path + "ScientaChannels", xdata)
|
||||
set_attribute(path + "ScientaChannels", ATTR_WRITABLE_DIMENSION, 1)
|
||||
set_attribute(path, "Range Low", params[1])
|
||||
set_attribute(path, "Range High", params[2])
|
||||
set_attribute(path, "Step Time", params[4])
|
||||
set_attribute(path, "Step Size", params[3])
|
||||
set_attribute(path, "Pass Energy", pass_energy)
|
||||
set_attribute(path, "Readables", ["ScientaSpectrum",])
|
||||
set_attribute(path, "Writables", ["ScientaChannels",])
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
|
||||
plots[cur_range+1].setTitle(str(params[0]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
finally:
|
||||
cur_range = -1
|
||||
if not Scienta.isReady():
|
||||
Scienta.stop()
|
||||
Scienta.update()
|
||||
task[0].cancel(True)
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
set_return(to_array(ret,'o'))
|
||||
44
script/users/Granas/noUse/ManipulatorScan_C1s.py
Normal file
44
script/users/Granas/noUse/ManipulatorScan_C1s.py
Normal file
@@ -0,0 +1,44 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of C1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
|
||||
mprint("___starting C1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/actual_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/C1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
|
||||
if True:
|
||||
ranges = [range1]
|
||||
# (eph, min, max, step, time, iter)
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
STEPS = 10
|
||||
MOTOR = dummy
|
||||
RANGE = (0,10)
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
time.sleep(10)
|
||||
44
script/users/Granas/noUse/ManipulatorScan_O1s.py
Normal file
44
script/users/Granas/noUse/ManipulatorScan_O1s.py
Normal file
@@ -0,0 +1,44 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of O1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
|
||||
mprint("___starting O1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/actual_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/O1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
|
||||
if True:
|
||||
ranges = [range1]
|
||||
# (eph, min, max, step, time, iter)
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
STEPS = 10
|
||||
MOTOR = dummy
|
||||
RANGE = (0,10)
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
time.sleep(4)
|
||||
182
script/users/Granas/noUse/XPSSpectrum.py
Normal file
182
script/users/Granas/noUse/XPSSpectrum.py
Normal file
@@ -0,0 +1,182 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of C1s test
|
||||
"""
|
||||
|
||||
|
||||
"""
|
||||
here the copy of XPSSpectrum starts
|
||||
|
||||
"""
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
cont =""
|
||||
command_path_tmp = "/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/set_measure.txt"
|
||||
if os.path.exists(command_path_tmp):
|
||||
cont = open(command_path_tmp).read()
|
||||
|
||||
ranges = []
|
||||
|
||||
select_edge_tmp = cont
|
||||
|
||||
|
||||
pass_energy = 20 #O1s
|
||||
#save_scienta_image = True
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
|
||||
# (eph, min, max, step, time, iter)
|
||||
if "O1s" in select_edge_tmp:
|
||||
mprint("___starting O1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/screw_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/FE_O1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
pass_energy = 20 #O1s
|
||||
#ranges.append((650.0, 645., 647.0, 0.1, 0.2, 10)) # O1s
|
||||
ranges.append(range1) #XX
|
||||
elif "C1s" in select_edge_tmp:
|
||||
mprint("___starting C1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/screw_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/FE_C1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
pass_energy = 50 #O1s
|
||||
ranges.append((390.0, 384.4, 387.0, 0.1, 0.2, 20)) # C1s
|
||||
#ranges.append(range1)#XX
|
||||
elif "test" in select_edge_tmp:
|
||||
mprint("___starting C1s measure___")
|
||||
range1 = getParameterset(pearlU_path+"settings/FE_C1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
print range1
|
||||
pass_energy = 20 #O1s
|
||||
ranges.append((390.0, 384.4, 387.0, 0.1, 0.2, 20)) # C1s
|
||||
#ranges.append(range1)#XX
|
||||
else:
|
||||
print "no command fount"
|
||||
|
||||
from ch.psi.pshell.data.LayoutDefault import ATTR_WRITABLE_DIMENSION as ATTR_WRITABLE_DIMENSION
|
||||
|
||||
cur_range = 0
|
||||
cur_iteration = 0
|
||||
|
||||
Scienta.acquisitionMode = Scienta.AcquisitionMode.Swept
|
||||
ret=[]
|
||||
|
||||
set_exec_pars(open = True)
|
||||
|
||||
#Global arguments
|
||||
Scienta.passEnergy = pass_energy
|
||||
|
||||
names=[]
|
||||
names.append("Online Spectrum")
|
||||
for i in range(len(ranges)):
|
||||
names.append(str(ranges[i][0]))
|
||||
plots = plot(None, names)
|
||||
spectrum_series = plots[0].getSeries(0)
|
||||
def plot_cur_spectrum():
|
||||
global spectrum_series
|
||||
try:
|
||||
while get_context().state.running:
|
||||
y = Scienta.spectrum.take(100)
|
||||
x = Scienta.spectrumX
|
||||
spectrum_series.setData(x, y)
|
||||
time.sleep(1.0)
|
||||
finally:
|
||||
print "Stopping spectrum plotting"
|
||||
task = None
|
||||
|
||||
try:
|
||||
for cur_range in range(len(ranges)):
|
||||
cur_iteration = 0
|
||||
skip_iteration = False
|
||||
params = ranges[cur_range]
|
||||
Eph.move(params[0])
|
||||
time.sleep(5.0)
|
||||
Scienta.lowEnergy.write(params[1])
|
||||
Scienta.highEnergy.write(params[2])
|
||||
Scienta.update()
|
||||
|
||||
Scienta.stepSize.write(params[3])
|
||||
Scienta.stepTime.write(params[4])
|
||||
Scienta.setIterations(1)
|
||||
|
||||
set_adc_averaging()
|
||||
|
||||
#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(params[5]):
|
||||
plots[cur_range+1].setTitle(str(params[0]) + " - iteration " + str(cur_iteration+1))
|
||||
while True:
|
||||
wait_beam()
|
||||
trig_scienta()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
if beam_ok:
|
||||
break
|
||||
if ydata is None:
|
||||
ydata = spectrum_array
|
||||
else:
|
||||
for k in range (len(spectrum_array)):
|
||||
ydata[k] = ydata[k] + spectrum_array[k]
|
||||
if xdata is None:
|
||||
xdata = Scienta.spectrumX
|
||||
plots[cur_range+1].getSeries(0).setData(xdata, ydata)
|
||||
if skip_iteration:
|
||||
break
|
||||
save_dataset(path + "ScientaSpectrum", ydata)
|
||||
set_attribute(path, "Iterations",cur_iteration+1)
|
||||
if cur_iteration==0:
|
||||
save_dataset(path + "ScientaChannels", xdata)
|
||||
set_attribute(path + "ScientaChannels", ATTR_WRITABLE_DIMENSION, 1)
|
||||
set_attribute(path, "Range Low", params[1])
|
||||
set_attribute(path, "Range High", params[2])
|
||||
set_attribute(path, "Step Time", params[4])
|
||||
set_attribute(path, "Step Size", params[3])
|
||||
set_attribute(path, "Pass Energy", pass_energy)
|
||||
set_attribute(path, "Readables", ["ScientaSpectrum",])
|
||||
set_attribute(path, "Writables", ["ScientaChannels",])
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
|
||||
plots[cur_range+1].setTitle(str(params[0]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
finally:
|
||||
cur_range = -1
|
||||
if not Scienta.isReady():
|
||||
Scienta.stop()
|
||||
Scienta.update()
|
||||
task[0].cancel(True)
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
set_return(to_array(ret,'o'))
|
||||
57
script/users/Granas/noUse/XPSSpectrum_C1s.py
Normal file
57
script/users/Granas/noUse/XPSSpectrum_C1s.py
Normal file
@@ -0,0 +1,57 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of C1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
|
||||
mprint("___starting FE_C1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/screw_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/FE_C1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
ranges =[]
|
||||
|
||||
if len(range1) >5 :
|
||||
ranges.append((range1[0],range1[1],range1[2],range1[3],range1[4],int(round(range1[5]))))
|
||||
|
||||
# (eph, min, max, step, time, iter)
|
||||
#save_scienta_image = True
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
|
||||
pass_energy = 50
|
||||
print "checkpoint"
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
time.sleep(4)
|
||||
56
script/users/Granas/noUse/XPSSpectrum_O1s.py
Normal file
56
script/users/Granas/noUse/XPSSpectrum_O1s.py
Normal file
@@ -0,0 +1,56 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of O1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
ranges=[]
|
||||
mprint("___starting O1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/screw_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/FE_O1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
|
||||
|
||||
if len(range1)>5:
|
||||
ranges.append((range1[0],range1[1],range1[2],range1[3],range1[4],int(round(range1[5]))))
|
||||
# (eph, min, max, step, time, iter)
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
pass_energy = 20
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
print "got to checkpoint"
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
writeCommand(" O1s ")
|
||||
time.sleep(4)
|
||||
162
script/users/Granas/noUse/XPSSpectrum_backup.py
Normal file
162
script/users/Granas/noUse/XPSSpectrum_backup.py
Normal file
@@ -0,0 +1,162 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of C1s test
|
||||
"""
|
||||
|
||||
#my debug
|
||||
def my_debug(str_):
|
||||
open("/sls/X03DA/data/gac-03da/Data1/2018/10/Granas/XPSstuff/commands/debugging.txt",'a').write(time.strftime("%H:%M")+" "+ str_+"\n")
|
||||
print(str_)
|
||||
|
||||
"""
|
||||
here the copy of XPSSpectrum starts
|
||||
|
||||
"""
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
cont =""
|
||||
command_path_tmp = "/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/set_measure.txt"
|
||||
if os.path.exists(command_path_tmp):
|
||||
cont = open(command_path_tmp).read()
|
||||
|
||||
ranges = []
|
||||
|
||||
select_edge_tmp = cont
|
||||
|
||||
|
||||
pass_energy = 20 #O1s
|
||||
#save_scienta_image = True
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
|
||||
# (eph, min, max, step, time, iter)
|
||||
if "O1s" in select_edge_tmp:
|
||||
pass_energy = 50 #C1s
|
||||
ranges.append((650.0, 645., 647.0, 0.1, 0.2, 10)) # O1s
|
||||
elif "C1s" in select_edge_tmp:
|
||||
ranges.append((390.0, 384.4, 387.0, 0.1, 0.2, 20)) # C1s
|
||||
else:
|
||||
print "no command fount"
|
||||
from ch.psi.pshell.data.LayoutDefault import ATTR_WRITABLE_DIMENSION as ATTR_WRITABLE_DIMENSION
|
||||
|
||||
cur_range = 0
|
||||
cur_iteration = 0
|
||||
|
||||
Scienta.acquisitionMode = Scienta.AcquisitionMode.Swept
|
||||
ret=[]
|
||||
|
||||
set_exec_pars(open = True)
|
||||
|
||||
#Global arguments
|
||||
Scienta.passEnergy = pass_energy
|
||||
|
||||
names=[]
|
||||
names.append("Online Spectrum")
|
||||
for i in range(len(ranges)):
|
||||
names.append(str(ranges[i][0]))
|
||||
plots = plot(None, names)
|
||||
spectrum_series = plots[0].getSeries(0)
|
||||
def plot_cur_spectrum():
|
||||
global spectrum_series
|
||||
try:
|
||||
while get_context().state.running:
|
||||
y = Scienta.spectrum.take(100)
|
||||
x = Scienta.spectrumX
|
||||
spectrum_series.setData(x, y)
|
||||
time.sleep(1.0)
|
||||
finally:
|
||||
print "Stopping spectrum plotting"
|
||||
task = None
|
||||
|
||||
try:
|
||||
for cur_range in range(len(ranges)):
|
||||
cur_iteration = 0
|
||||
skip_iteration = False
|
||||
params = ranges[cur_range]
|
||||
Eph.move(params[0])
|
||||
time.sleep(5.0)
|
||||
Scienta.lowEnergy.write(params[1])
|
||||
Scienta.highEnergy.write(params[2])
|
||||
Scienta.update()
|
||||
|
||||
Scienta.stepSize.write(params[3])
|
||||
Scienta.stepTime.write(params[4])
|
||||
Scienta.setIterations(1)
|
||||
|
||||
set_adc_averaging()
|
||||
|
||||
#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(params[5]):
|
||||
plots[cur_range+1].setTitle(str(params[0]) + " - iteration " + str(cur_iteration+1))
|
||||
while True:
|
||||
wait_beam()
|
||||
trig_scienta()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
if beam_ok:
|
||||
break
|
||||
if ydata is None:
|
||||
ydata = spectrum_array
|
||||
else:
|
||||
for k in range (len(spectrum_array)):
|
||||
ydata[k] = ydata[k] + spectrum_array[k]
|
||||
if xdata is None:
|
||||
xdata = Scienta.spectrumX
|
||||
plots[cur_range+1].getSeries(0).setData(xdata, ydata)
|
||||
if skip_iteration:
|
||||
break
|
||||
save_dataset(path + "ScientaSpectrum", ydata)
|
||||
set_attribute(path, "Iterations",cur_iteration+1)
|
||||
if cur_iteration==0:
|
||||
save_dataset(path + "ScientaChannels", xdata)
|
||||
set_attribute(path + "ScientaChannels", ATTR_WRITABLE_DIMENSION, 1)
|
||||
set_attribute(path, "Range Low", params[1])
|
||||
set_attribute(path, "Range High", params[2])
|
||||
set_attribute(path, "Step Time", params[4])
|
||||
set_attribute(path, "Step Size", params[3])
|
||||
set_attribute(path, "Pass Energy", pass_energy)
|
||||
set_attribute(path, "Readables", ["ScientaSpectrum",])
|
||||
set_attribute(path, "Writables", ["ScientaChannels",])
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
|
||||
plots[cur_range+1].setTitle(str(params[0]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
finally:
|
||||
cur_range = -1
|
||||
if not Scienta.isReady():
|
||||
Scienta.stop()
|
||||
Scienta.update()
|
||||
task[0].cancel(True)
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
set_return(to_array(ret,'o'))
|
||||
56
script/users/Granas/noUse/XPSSpectrum_nackup.py
Normal file
56
script/users/Granas/noUse/XPSSpectrum_nackup.py
Normal file
@@ -0,0 +1,56 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of O1s test
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
|
||||
global ranges, pass_energy, skip_iteration, ENDSCAN
|
||||
""" old settings
|
||||
ranges = []
|
||||
# (eph, min, max, step, time, iter)
|
||||
ranges.append((1300.0, 577.0, 593.0, 0.1, 0.2, 1700))
|
||||
ranges.append((1300.0, 713.0, 722.0, 0.1, 0.2, 1000))
|
||||
ranges.append((1300.0, 1294.5, 1297.0, 0.02, 1, 2))
|
||||
pass_energy = 50
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
"""
|
||||
|
||||
#importing pearlUtils
|
||||
execfile("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/pearlUtils.py")
|
||||
|
||||
mprint("___starting O1s measure___")
|
||||
loadParameterset(pearlU_path+"settings/screw_GE_pos.txt")
|
||||
range1 = getParameterset(pearlU_path+"settings/FE_O1s.txt")
|
||||
waitForEnergy(range1[0])
|
||||
waitForGroup("mov-")
|
||||
print range1
|
||||
|
||||
|
||||
if len(range1)>5:
|
||||
ranges = [range1]
|
||||
# (eph, min, max, step, time, iter)
|
||||
|
||||
skip_iteration = False
|
||||
ENDSCAN = True
|
||||
pass_energy = 20
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","1") #opening the beam line
|
||||
time.sleep(4)
|
||||
print "got to checkpoint"
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum_base.py")
|
||||
|
||||
setVal("X03DA-FE-AB1:CLOSE4BL","0") #closeing the beam line
|
||||
|
||||
writeCommand(" O1s ")
|
||||
time.sleep(4)
|
||||
154
script/users/Granas/noUse/XPSSpectrum_old.py
Normal file
154
script/users/Granas/noUse/XPSSpectrum_old.py
Normal file
@@ -0,0 +1,154 @@
|
||||
#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
|
||||
import org.jfree.chart.axis.NumberAxis as NumberAxis
|
||||
|
||||
cur_range = 0
|
||||
cur_iteration = 0
|
||||
|
||||
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)
|
||||
|
||||
#Global arguments
|
||||
Scienta.passEnergy = pass_energy
|
||||
|
||||
names=[]
|
||||
names.append("Online Spectrum")
|
||||
for i in range(len(ranges)):
|
||||
names.append(str(ranges[i]))
|
||||
plots = plot(None, names)
|
||||
|
||||
for p in plots:
|
||||
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
|
||||
|
||||
|
||||
# online spectrum
|
||||
|
||||
p = plots[0]
|
||||
spectrum_series = p.getSeries(0)
|
||||
spectrum_eb_axis = p.chart.plot.getDomainAxis(1)
|
||||
def plot_cur_spectrum():
|
||||
global spectrum_series
|
||||
global spectrum_eb_axis
|
||||
try:
|
||||
while get_context().state.running:
|
||||
y = Scienta.spectrum.take(100)
|
||||
x = Scienta.spectrumX
|
||||
spectrum_series.setData(x, y)
|
||||
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)
|
||||
time.sleep(1.0)
|
||||
finally:
|
||||
print "Stopping spectrum plotting"
|
||||
task = None
|
||||
|
||||
|
||||
# measurements
|
||||
|
||||
try:
|
||||
for cur_range in range(len(ranges)):
|
||||
cur_iteration = 0
|
||||
skip_iteration = False
|
||||
Scienta.lowEnergy.write(adjusted_ranges[cur_range][0])
|
||||
Scienta.highEnergy.write(adjusted_ranges[cur_range][1])
|
||||
Scienta.update()
|
||||
|
||||
vars = ranges[cur_range].vars
|
||||
Scienta.stepTime.write(vars[0])
|
||||
Scienta.stepSize.write(vars[1])
|
||||
Scienta.setIterations(1)
|
||||
|
||||
set_adc_averaging()
|
||||
|
||||
#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]):
|
||||
p = plots[cur_range+1]
|
||||
p.setTitle(str(ranges[cur_range]) + " - iteration " + str(cur_iteration+1))
|
||||
while True:
|
||||
wait_beam()
|
||||
trig_scienta()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
if beam_ok:
|
||||
break
|
||||
if ydata is None:
|
||||
ydata = spectrum_array
|
||||
else:
|
||||
for k in range (len(spectrum_array)):
|
||||
ydata[k] = ydata[k] + spectrum_array[k]
|
||||
if xdata is None:
|
||||
xdata = Scienta.spectrumX
|
||||
p.getSeries(0).setData(xdata, ydata)
|
||||
eb_axis = p.chart.plot.getDomainAxis(1)
|
||||
eb1 = Eph.take(100) - Scienta.lowEnergy.take(100) - 4.5
|
||||
eb2 = Eph.take(100) - Scienta.highEnergy.take(100) - 4.5
|
||||
eb_axis.setRange(eb2, eb1)
|
||||
|
||||
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", 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",])
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
|
||||
plots[cur_range+1].setTitle(str(ranges[cur_range]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
|
||||
finally:
|
||||
cur_range = -1
|
||||
if not Scienta.isReady():
|
||||
Scienta.stop()
|
||||
Scienta.update()
|
||||
task[0].cancel(True)
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
set_return(to_array(ret,'o'))
|
||||
40
script/users/Granas/noUse/automise.py
Normal file
40
script/users/Granas/noUse/automise.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
2018-10-13
|
||||
author: christoph Seitz
|
||||
|
||||
"""
|
||||
|
||||
|
||||
command_path_tmp = "/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/set_measure.txt"
|
||||
print __name__
|
||||
while:
|
||||
time.sleep(4)
|
||||
if os.path.exists(command_path_tmp):
|
||||
cont = open(command_path_tmp).read() #reading command from file
|
||||
if "manipulator spectrum O1s" in cont:
|
||||
select_edge_tmp = "O1s "
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan.py")
|
||||
elif "fermi edge O1s" in cont:
|
||||
select_edge_tmp = "O1s "
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum.py")
|
||||
# check values carefully
|
||||
elif "fermi edge C1s" in cont:
|
||||
select_edge_tmp = "C1s "
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/XPSSpectrum.py")
|
||||
elif "manipulator spectrum C1s" in cont:
|
||||
select_edge_tmp = "C1s "
|
||||
execfile("/sls/X03DA/data/gac-x03da/pshell/home/script/users/Granas/ManipulatorScan.py")
|
||||
if "exit_loop":
|
||||
break
|
||||
|
||||
#printing the end to file
|
||||
for i in range(3):
|
||||
try:
|
||||
print("loop is closed now")
|
||||
open(path,'w').write("loop is closed now")
|
||||
break
|
||||
except:
|
||||
print("ending loop failed")
|
||||
print("trying again")
|
||||
|
||||
|
||||
191
script/users/Granas/noUse/xps_measure.py
Normal file
191
script/users/Granas/noUse/xps_measure.py
Normal file
@@ -0,0 +1,191 @@
|
||||
"""
|
||||
author chritstoph seitz
|
||||
|
||||
starting the xps measurement
|
||||
|
||||
Fermi edge of C1s test
|
||||
"""
|
||||
|
||||
#my debug
|
||||
def my_debug(str_):
|
||||
open("/sls/X03DA/data/gac-x03da/Data1/2018/10/Granas/XPSstuff/commands/debugging.txt",'a').write(time.strftime("%H:%M")+" "+ str_)
|
||||
print(str_)
|
||||
|
||||
|
||||
|
||||
ranges = []
|
||||
|
||||
select_edge_tmp = "C1s "
|
||||
pass_energy = 20 #O1s
|
||||
|
||||
#save_scienta_image = True
|
||||
|
||||
skip_iteration = 0
|
||||
|
||||
# (eph, min, max, step, time, iter)
|
||||
if "O1s" in select_edge_tmp:
|
||||
pass_energy = 50 #C1s
|
||||
ranges.append((650.0, 645., 647.0, 0.1, 0.2, 10)) # O1s
|
||||
elif "C1s" in select_edge_tmp:
|
||||
ranges.append((390.0, 384.4, 387.0, 0.1, 0.2, 20)) # C1s
|
||||
|
||||
"""
|
||||
here the copy of XPSSpectrum starts
|
||||
|
||||
"""
|
||||
|
||||
|
||||
#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
|
||||
import org.jfree.chart.axis.NumberAxis as NumberAxis
|
||||
|
||||
cur_range = 0
|
||||
cur_iteration = 0
|
||||
|
||||
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)
|
||||
|
||||
#Global arguments
|
||||
Scienta.passEnergy = pass_energy
|
||||
|
||||
names=[]
|
||||
names.append("Online Spectrum")
|
||||
for i in range(len(ranges)):
|
||||
names.append(str(ranges[i]))
|
||||
plots = plot(None, names)
|
||||
|
||||
for p in plots:
|
||||
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
|
||||
|
||||
|
||||
# online spectrum
|
||||
|
||||
p = plots[0]
|
||||
spectrum_series = p.getSeries(0)
|
||||
spectrum_eb_axis = p.chart.plot.getDomainAxis(1)
|
||||
def plot_cur_spectrum():
|
||||
global spectrum_series
|
||||
global spectrum_eb_axis
|
||||
try:
|
||||
while get_context().state.running:
|
||||
y = Scienta.spectrum.take(100)
|
||||
x = Scienta.spectrumX
|
||||
spectrum_series.setData(x, y)
|
||||
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)
|
||||
time.sleep(1.0)
|
||||
finally:
|
||||
print "Stopping spectrum plotting"
|
||||
task = None
|
||||
|
||||
my_degub("#measurements reached")
|
||||
# measurements
|
||||
|
||||
try:
|
||||
for cur_range in range(len(ranges)):
|
||||
cur_iteration = 0
|
||||
skip_iteration = False
|
||||
Scienta.lowEnergy.write(adjusted_ranges[cur_range][0])
|
||||
Scienta.highEnergy.write(adjusted_ranges[cur_range][1])
|
||||
Scienta.update()
|
||||
|
||||
vars = ranges[cur_range].vars
|
||||
Scienta.stepTime.write(vars[0])
|
||||
Scienta.stepSize.write(vars[1])
|
||||
Scienta.setIterations(1)
|
||||
|
||||
set_adc_averaging()
|
||||
my_degub("#interations reached")
|
||||
#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]):
|
||||
p = plots[cur_range+1]
|
||||
p.setTitle(str(ranges[cur_range]) + " - iteration " + str(cur_iteration+1))
|
||||
while True:
|
||||
wait_beam()
|
||||
trig_scienta()
|
||||
spectrum_array = Scienta.spectrum.read()
|
||||
if beam_ok:
|
||||
break
|
||||
if ydata is None:
|
||||
ydata = spectrum_array
|
||||
else:
|
||||
for k in range (len(spectrum_array)):
|
||||
ydata[k] = ydata[k] + spectrum_array[k]
|
||||
if xdata is None:
|
||||
xdata = Scienta.spectrumX
|
||||
p.getSeries(0).setData(xdata, ydata)
|
||||
eb_axis = p.chart.plot.getDomainAxis(1)
|
||||
eb1 = Eph.take(100) - Scienta.lowEnergy.take(100) - 4.5
|
||||
eb2 = Eph.take(100) - Scienta.highEnergy.take(100) - 4.5
|
||||
eb_axis.setRange(eb2, eb1)
|
||||
|
||||
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", 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",])
|
||||
create_diag_datasets(path)
|
||||
append_diag_datasets(path)
|
||||
|
||||
plots[cur_range+1].setTitle(str(ranges[cur_range]))
|
||||
ret.append((xdata, ydata))
|
||||
|
||||
|
||||
finally:
|
||||
cur_range = -1
|
||||
if not Scienta.isReady():
|
||||
Scienta.stop()
|
||||
Scienta.update()
|
||||
task[0].cancel(True)
|
||||
if ENDSCAN:
|
||||
after_scan()
|
||||
|
||||
set_return(to_array(ret,'o'))
|
||||
1
script/users/Granas/xps_measure.py~
Normal file
1
script/users/Granas/xps_measure.py~
Normal file
@@ -0,0 +1 @@
|
||||
test
|
||||
Reference in New Issue
Block a user