From 04542f653ecc02a339369493d19bba4619dc7da2 Mon Sep 17 00:00:00 2001 From: x03daop Date: Sun, 11 Sep 2016 17:06:58 +0200 Subject: [PATCH] Script execution --- script/HbnPhdScript.py | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 script/HbnPhdScript.py diff --git a/script/HbnPhdScript.py b/script/HbnPhdScript.py new file mode 100644 index 00000000..330608d0 --- /dev/null +++ b/script/HbnPhdScript.py @@ -0,0 +1,53 @@ +""" +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) +""" + +global VECTOR, SENSORS + +MODE = "swept" +LATENCY = 2.0 +SENSORS = [Counts, Scienta.dataMatrix, SampleCurrent, RefCurrent, MachineCurrent] + +Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept) +writables = (Eph, Scienta.lowEnergy, Scienta.highEnergy) + +adjust_sensors() +SampleCurrentAveraging.write(600) +RefCurrentAveraging.write(600) +set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1}) + +try: + # N-B + eph = [425.0 + i * 2.5 for i in range(121)] + elo = [19.0 + i * 2.5 for i in range(121)] + ehi = [29.0 + i * 2.5 for i in range(121)] + VECTOR = [eph, elo, ehi] + ManipulatorPhi.move(+21.1) + ManipulatorTilt.move(+0.5) + Scienta.getStepTime().write(0.824) + vscan(writables, SENSORS, VECTOR, True, LATENCY, False, before_read=before_readout, after_read = after_readout) + + # N-N + ManipulatorPhi.move(-8.9) + ManipulatorTilt.move(+0.5) + Scienta.getStepTime().write(0.824) + vscan(writables, SENSORS, VECTOR, True, LATENCY, False, before_read=before_readout, after_read = after_readout) + + # B-Cu + eph = [218.0 + i * 2.5 for i in range(121)] + elo = [19.0 + i * 2.5 for i in range(121)] + ehi = [29.0 + i * 2.5 for i in range(121)] + VECTOR = [eph, elo, ehi] + ManipulatorPhi.move(+21.1) + ManipulatorTilt.move(+25.5) + Scienta.getStepTime().write(1.47) + vscan(writables, SENSORS, VECTOR, True, LATENCY, False, before_read=before_readout, after_read = after_readout) +finally: + after_scan()