From 1a9cac0a26599c63c06db53c2cab3cc49d12d547 Mon Sep 17 00:00:00 2001 From: x03daop Date: Wed, 30 Aug 2017 20:57:33 +0200 Subject: [PATCH] Startup --- script/users/HoloScan-Andrew.py | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 script/users/HoloScan-Andrew.py diff --git a/script/users/HoloScan-Andrew.py b/script/users/HoloScan-Andrew.py new file mode 100644 index 00000000..31832ec9 --- /dev/null +++ b/script/users/HoloScan-Andrew.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 = [int(i/46)*36.0-165.0 for i in range(460)] + theta = [(i%46)*2.0-9.0 for i in range(460)] + x = [2.37*math.cos((th+9.0)*math.pi/180.0)-2.67 for th in theta] + y = [2.37*math.sin((th+9.0)*math.pi/180.0)-0.2 for th in theta] + #VECTOR = [phi, theta, x, y] + VECTOR = [[phi[i], theta[i], x[i], y[i]] for i in range(460)] + # 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()