60 lines
1.7 KiB
Python
60 lines
1.7 KiB
Python
#####################
|
|
## INPUT PARAMETERS##
|
|
|
|
POS_START = 156.0 #Minn = 150.0
|
|
POS_END = 162 #Max = 170.0
|
|
POS_STEP = 0.25
|
|
|
|
|
|
#ENERGIES = [363.2, 356.0]# Nb
|
|
#ENERGIES = [774. 0] # Co
|
|
#ENERGIES = [577.0, 573.0] # Cr
|
|
#ENERGIES = [708.3,704.0] # Fe
|
|
#ENERGIES = [928.4, 925.0 ] # Cu
|
|
#ENERGIES = [700.0]
|
|
#ENERGIES = [706.7,708.3,704.0] # Fe
|
|
#ENERGIES = [851.3,845]#[851.2,848.0] # Ni
|
|
#ENERGIES = [280,292] #C
|
|
#ENERGIES = [776.9,774] # Co
|
|
#ENERGIES = [642.0,630.0] # Mn
|
|
ENERGIES = [1067, 1076 ] # Sm
|
|
#ENERGIES = [870, 880.3 ] # Ce
|
|
|
|
|
|
|
|
#####################
|
|
|
|
#open_valve()
|
|
sensors = [tey_norm,signal_tey, signal_i0, signal_trans, trans_norm, sample_vert, energy_readback]
|
|
|
|
#TODO: #Why must set range to "auto"?
|
|
'''
|
|
def before_pass(pass_num, scan):
|
|
print "Setting energy = " , ENERGIES[pass_num-1]
|
|
set_energy(ENERGIES[pass_num-1])
|
|
lscan(sample_vert,sensors, POS_START, POS_END, POS_STEP, latency =0.5, passes = len(ENERGIES), before_pass=before_pass, range="auto")
|
|
'''
|
|
|
|
#Setting a different color for each pass: must manage plots manually
|
|
#del name
|
|
print tey_norm.name
|
|
|
|
plots = plot([None]*len(sensors), name = [d.name for d in sensors])
|
|
for p in plots:
|
|
p.clear()
|
|
p.legendVisible = True
|
|
|
|
def after_readout(record, scan):
|
|
for i in range(len(plots)):
|
|
plots[i].getSeries(plots[i].numberOfSeries-1).appendData(record.positions[0], record.values[i])
|
|
def before_pass(pass_num):
|
|
en = ENERGIES[pass_num-1]
|
|
set_energy(en)
|
|
open_valve()
|
|
|
|
for p in plots: p.addSeries(LinePlotSeries(str(en)))
|
|
|
|
ret= lscan(sample_hor,sensors, POS_START, POS_END, POS_STEP, latency = 0.0, passes = len(ENERGIES), before_pass = before_pass, after_read=after_readout, plot_disabled=True, range="auto")
|
|
|
|
close_valve()
|