Script execution
This commit is contained in:
@@ -39,8 +39,6 @@ ZIGZAG = True
|
||||
positions = [(PHI_RANGE[0], THETA_RANGE[0]), (PHI_RANGE[1], THETA_RANGE[1]), STEPS]
|
||||
LATENCY=0.0
|
||||
|
||||
REGION = {'name': 'Tb 4d', 'elo': 892.5, 'ehi': 899.0, 'estep': 0.1, 'epass': 50., 'tstep': 0.8, 'iter': 1}
|
||||
|
||||
# close beam shutter and turn off analyser at the end of the scan
|
||||
CLOSE_SHUTTER_AT_END = False
|
||||
|
||||
@@ -50,65 +48,42 @@ CLOSE_SHUTTER_AT_END = False
|
||||
set_exec_pars(keep=False)
|
||||
set_exec_pars(compression=True)
|
||||
|
||||
def check_region(region):
|
||||
"""
|
||||
check region dictionary items and apply defaults where necessary
|
||||
"""
|
||||
print(region)
|
||||
region['fixed'] = 'efix' in region
|
||||
print(region)
|
||||
if region['fixed']:
|
||||
region['elo'] = region['efix']
|
||||
region['ehi'] = region['efix']
|
||||
if 'iter' not in region:
|
||||
region['iter'] = 1
|
||||
try:
|
||||
Eph.move(ephot)
|
||||
except ValueError:
|
||||
ephot = Eph.take(100)
|
||||
|
||||
if efix:
|
||||
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Fixed)
|
||||
Scienta.centerEnergy.write(elo)
|
||||
else:
|
||||
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 KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
Scienta.stepTime.write(tstep)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
Scienta.setIterations(iter)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
ExitSlit.write(slit)
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
def set_region(params):
|
||||
try:
|
||||
ephot = self.region['ephot']
|
||||
Eph.move(ephot)
|
||||
except KeyError:
|
||||
ephot = Eph.take(100)
|
||||
Scienta.update()
|
||||
|
||||
elo = self.region['elo']
|
||||
ehi = self.region['ehi']
|
||||
|
||||
if self.region['fixed']:
|
||||
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Fixed)
|
||||
Scienta.centerEnergy.write(elo)
|
||||
else:
|
||||
Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept)
|
||||
Scienta.lowEnergy.write(elo)
|
||||
Scienta.highEnergy.write(ehi)
|
||||
Scienta.stepSize.write(self.region['estep'])
|
||||
|
||||
try:
|
||||
Scienta.setPassEnergy(int(self.region['epass']))
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
Scienta.stepTime.write(self.region['tstep'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
Scienta.setIterations(self.region['iter'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
ExitSlit.write(self.region['slit'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
Scienta.update()
|
||||
|
||||
|
||||
# main
|
||||
|
||||
check_region(region)
|
||||
set_region(region)
|
||||
adjust_sensors()
|
||||
set_adc_averaging()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user