From 35ad4ed00fcfc0939df16fde91f921e8f06de53b Mon Sep 17 00:00:00 2001 From: gac-x03da Date: Sat, 30 Nov 2019 14:12:42 +0100 Subject: [PATCH] Script execution --- script/PhotonEnergyManipulator.py | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 script/PhotonEnergyManipulator.py diff --git a/script/PhotonEnergyManipulator.py b/script/PhotonEnergyManipulator.py new file mode 100644 index 00000000..c02acc49 --- /dev/null +++ b/script/PhotonEnergyManipulator.py @@ -0,0 +1,33 @@ +# set STARTPOS, ENDPOS, STEPS to the proper values + +# swept mode +# for fixed mode, remove kinetic_high +STARTPOS = (131, 115.5, 120.5, -3.8, -2.05) +ENDPOS = (139, 123.5, 128.5, -3.9, -2.15) +# actually executed number is +1, i believe +STEPS = 2 + +RELATIVE = False +SENSORS = (Counts, SampleCurrent, RefCurrent, MachineCurrent, EnergyDistribution, AngleDistribution, Scienta.dataMatrix) +LATENCY = 1. + +if len(STARTPOS) == 4: + #FIXED + Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Fixed) + Scienta.centerEnergy.write(STARTPOS[1]) + MOTOR = (Eph, Scienta.centerEnergy, ManipulatorX, ManipulatorY) +else: + #SWEPT + Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept) + Scienta.lowEnergy.write(STARTPOS[1]) + Scienta.highEnergy.write(STARTPOS[2]) + MOTOR = (Eph, Scienta.lowEnergy, Scienta.highEnergy, ManipulatorX, ManipulatorY) + +adjust_sensors() +set_adc_averaging() + +try: + lscan(MOTOR, SENSORS, STARTPOS, ENDPOS, STEPS, LATENCY, RELATIVE, before_read=before_readout, after_read = after_readout) +finally: + if ENDSCAN: + after_scan()