Files
x03da/script/QueuedHoloScan.py
2021-11-03 18:36:05 +01:00

102 lines
2.7 KiB
Python

"""
parametric holo scan of one spectral regions for pshell queue
parameters:
phi_range: (tuple (min, max)) defaults to hard-coded PHI_RANGE
theta_range: (tuple (min, max)) defaults to hard-coded THETA_RANGE
steps: (tuple (phi, theta)) defaults to hard-coded STEPS
region: (dict)
optional items can be left unspecified and will default to the indicated values.
for swept mode, include 'elo', 'ehi', 'estep', 'iter' values, but do not include 'efix'.
for fixed mode, include 'efix' value, but do not include 'elo', 'ehi', 'estep', 'iter'.
'name': user-specific name of the region
'elo': lower kinetic energy boundary of the spectrum
'ehi': upper kinetic energy boundary of the spectrum
'estep': energy step size
'efix': center kinetic energy in fixed mode
'epass': pass energy
'ephot': photon energy (default: unchanged)
'tstep': dwell time in seconds
'iter': number of iterations/sweeps (default 1)
'slit': exit slit (default: unchanged)
motors: (sequence, optional) position devices
sensors: (sequence, optional) sensor devices
"""
MOTORS = (ManipulatorPhi, ManipulatorTheta)
SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution, Scienta.dataMatrix)
PHI_RANGE = (-170.0, 170.0) # (tuple (min, max))
THETA_RANGE = (-9.5, 80.5) # (tuple (min, max))
STEPS = (40.0, 1.0) # (tuple (phi, theta))
ZIGZAG = True
LATENCY=0.0
# close beam shutter and turn off analyser at the end of the scan
CLOSE_SHUTTER_AT_END = False
# --- DO NOT EDIT BELOW THIS LINE! ---
motors = MOTORS
sensors = SENSORS
phi_range = PHI_RANGE
theta_range = THETA_RANGE
steps = STEPS
zigzag = ZIGZAG
latency = LATENCY
positions = [(phi_range[0], theta_range[0]), (phi_range[1], theta_range[1]), steps]
set_exec_pars(keep=False)
set_exec_pars(compression=True)
try:
Eph.move(ephot)
except NameError:
ephot = Eph.take(100)
try:
Scienta.centerEnergy.write(efix)
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Fixed)
except NameError:
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept)
Scienta.lowEnergy.write(elo)
Scienta.highEnergy.write(ehi)
Scienta.stepSize.write(estep)
try:
Scienta.setPassEnergy(int(epass))
except NameError:
pass
try:
Scienta.stepTime.write(tstep)
except NameError:
pass
try:
Scienta.setIterations(iterations)
except NameError:
pass
try:
ExitSlit.write(slit)
except NameError:
pass
Scienta.update()
adjust_sensors()
set_adc_averaging()
try:
ascan(motors, sensors, positions[0], positions[1], positions[2], latency, False, zigzag=zigzag, before_read=before_readout, after_read = after_readout, check_positions=False)
finally:
if CLOSE_SHUTTER_AT_END:
after_scan()