Script execution
This commit is contained in:
75
script/users/PhotonEnergyManipulator.py
Normal file
75
script/users/PhotonEnergyManipulator.py
Normal file
@@ -0,0 +1,75 @@
|
||||
"""
|
||||
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 = 625.
|
||||
EPHOT_HI = 630.
|
||||
EPHOT_STEP = 1.
|
||||
|
||||
# energy range of first spectrum
|
||||
EKIN_LO = 100.
|
||||
EKIN_HI = 110.
|
||||
EKIN_STEP = 0.1
|
||||
# 'CIS' = constant initial state (binding energy), 'CFS' = constant final state (kinetic energy)
|
||||
TYPE = 'CFS'
|
||||
|
||||
# manipulator range
|
||||
MANIP_START = 116.4
|
||||
MANIP_END = 116.6
|
||||
|
||||
|
||||
### do not edit below
|
||||
|
||||
NSTEPS = 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.centerEnergy.write(VECTOR[0][1])
|
||||
writables = (Eph, Scienta.centerEnergy, 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.lowEnergy.write(VECTOR[0][1])
|
||||
Scienta.highEnergy.write(VECTOR[0][2])
|
||||
writables = (Eph, Scienta.lowEnergy, Scienta.highEnergy, 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()
|
||||
Reference in New Issue
Block a user