From 571b0af047a0af6ea8440797e18b776c5eaf722b Mon Sep 17 00:00:00 2001 From: x03daop Date: Sat, 22 Jul 2017 02:49:26 +0200 Subject: [PATCH] Script execution --- script/users/HoloScan-Yasmine2.py | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 script/users/HoloScan-Yasmine2.py diff --git a/script/users/HoloScan-Yasmine2.py b/script/users/HoloScan-Yasmine2.py new file mode 100644 index 00000000..bf5394ad --- /dev/null +++ b/script/users/HoloScan-Yasmine2.py @@ -0,0 +1,54 @@ +""" +Arguments: + +SENSORS (list) +PHI_RANGE (tuple (min, max)) +THETA_RANGE (tuple (min, max)) +STEPS (tuple (phi, theta)) +LATENCY (double) +RELATIVE (BOOLEAN) +ZIGZAG (BOOLEAN) +""" +import math +global VECTOR, SENSORS + +MODE = "swept" +LATENCY = 0.0 +SENSORS = [Counts, Scienta.dataMatrix, SampleCurrent, RefCurrent, MachineCurrent] + +Scienta.setAcquisitionMode(ch.psi.pshell.epics.Scienta.AcquisitionMode.Swept) +writables = (ManipulatorPhi, ManipulatorTheta, ManipulatorX, ManipulatorY) + +adjust_sensors() +SampleCurrentAveraging.write(1660) +RefCurrentAveraging.write(1660) +set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1}) + +try: + # N-B + #VECTOR = [[425.0 + i * 2.5, 19.0 + i * 2.5, 29.0 + i * 2.5] for i in range(121)] + #ManipulatorPhi.move(+21.1) + #ManipulatorTilt.move(+0.5) + #Scienta.getStepTime().write(0.824) + #print VECTOR + #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 + phi = [30.5] + theta = [i * 1.0 - 11.0 for i in range(61)] + x = [3.0 * math.cos((th+9.0) * math.pi/180.0) - 1.69 for th in theta] + y = [3.0 * math.sin((th+9.0) * math.pi/180.0) - 0.933 for th in theta] + #VECTOR = [phi, theta, x, y] + VECTOR = [[phi[i], theta[i], x[i], y[i]] for i in range(61)] + # ManipulatorPhi.move(-8.9) + #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()