75 lines
2.1 KiB
Python
75 lines
2.1 KiB
Python
"""
|
|
photon energy (resonance) scan with parallel manipulator movement
|
|
(to distribute exposure over sample)
|
|
|
|
Arguments:
|
|
|
|
VECTOR (Double[][], Scan vector: Eph,Elow,Ehigh or Eph,Ecenter)
|
|
SENSORS (list)
|
|
LATENCY (double)
|
|
MODE ('fixed' or 'swept')
|
|
TYPE ('CIS' or 'CFS')
|
|
STEP (double)
|
|
ENDSCAN
|
|
"""
|
|
|
|
SENSORS = (Scienta.spectrum, Scienta.dataMatrix, Counts, SampleCurrent, RefCurrent, MachineCurrent)
|
|
LATENCY = 1.0
|
|
MODE = 'swept'
|
|
ENDSCAN = True
|
|
|
|
# photon energy scan range
|
|
EPHOT_LO = 132.
|
|
EPHOT_HI = 144.
|
|
EPHOT_STEP = 0.25
|
|
|
|
# energy range of first spectrum
|
|
EKIN_LO = 106.
|
|
EKIN_HI = 142.
|
|
EKIN_STEP = 0.05
|
|
# 'CIS' = constant initial state (binding energy), 'CFS' = constant final state (kinetic energy)
|
|
TYPE = 'CFS'
|
|
|
|
# manipulator range
|
|
MANIP_START = 114.
|
|
MANIP_END = 115.
|
|
|
|
|
|
### do not edit below
|
|
|
|
NSTEPS = int(round((EPHOT_HI - EPHOT_LO) / EPHOT_STEP) + 1)
|
|
EPHOT_STEP = (EPHOT_HI - EPHOT_LO) / (NSTEPS - 1)
|
|
|
|
ephot = [EPHOT_LO + EPHOT_STEP * i for i in range(NSTEPS)]
|
|
if TYPE == 'CIS':
|
|
eshift = [EPHOT_STEP * i for i in range(NSTEPS)]
|
|
else:
|
|
eshift = [0.] * NSTEPS
|
|
ekin_lo = [EKIN_LO + eshift[i] for i in range(NSTEPS)]
|
|
ekin_hi = [EKIN_HI + eshift[i] for i in range(NSTEPS)]
|
|
|
|
MANIP_STEP = (MANIP_END - MANIP_START) / (NSTEPS - 1)
|
|
manip_z = [MANIP_START + MANIP_STEP * i for i in range(NSTEPS)]
|
|
|
|
if MODE == "swept":
|
|
VECTOR = [[ephot[i], ekin_lo[i], ekin_hi[i], manip_z[i]] for i in range(NSTEPS)]
|
|
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept)
|
|
Scienta.lowEnergy.write(VECTOR[0][1])
|
|
Scienta.highEnergy.write(VECTOR[0][2])
|
|
writables = (Eph, Scienta.lowEnergy, Scienta.highEnergy, ManipulatorZ)
|
|
else:
|
|
VECTOR = [[ephot[i], ekin_lo[i], manip_z[i]] for i in range(NSTEPS)]
|
|
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Fixed)
|
|
Scienta.centerEnergy.write(VECTOR[0][1])
|
|
writables = (Eph, Scienta.centerEnergy, ManipulatorZ)
|
|
|
|
adjust_sensors()
|
|
set_adc_averaging()
|
|
set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1})
|
|
|
|
try:
|
|
vscan(writables, SENSORS, VECTOR, True, LATENCY,False, before_read=before_readout, after_read = after_readout)
|
|
finally:
|
|
if ENDSCAN:
|
|
after_scan()
|