diff --git a/script/users/DepthProfile-MilosB.py b/script/users/DepthProfile-MilosB.py new file mode 100644 index 00000000..61a44956 --- /dev/null +++ b/script/users/DepthProfile-MilosB.py @@ -0,0 +1,70 @@ +""" +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 = (ManipulatorTheta, ManipulatorX, ManipulatorY) + +adjust_sensors() +SampleCurrentAveraging.write(1660) +RefCurrentAveraging.write(1660) +set_preference(Preference.PLOT_TYPES, {'Scienta spectrum':1}) + +try: + # C + Scienta.getLowEnergy().write(190.0) + Scienta.getHighEnergy().write(222.0) + Scienta.getStepSize().write(0.1) + Scienta.getStepTime().write(0.2) + Scienta.setIterations(2) + Eph.move(505.0) + + theta = [-9.0,6.0,21.0,31.0,41.0,51.0,61.0,71.0] + x = [2.57*math.cos((th+9.0)*math.pi/180.0)-2.67 for th in theta] + y = [2.57*math.sin((th+9.0)*math.pi/180.0)-0.2 for th in theta] + VECTOR = [theta[i], x[i], y[i]] for i in range(len(theta))] + vscan(writables, SENSORS, VECTOR, True, LATENCY, False, before_read=before_readout, after_read = after_readout) + + # Zn + Scienta.getLowEnergy().write(175.0) + Scienta.getHighEnergy().write(220.0) + Scienta.getStepSize().write(0.1) + Scienta.getStepTime().write(1.0) + Scienta.setIterations(4) + Eph.move(1240.0) + + theta = [-9.0,6.0,21.0,31.0,41.0,51.0,61.0,71.0] + x = [2.57*math.cos((th+9.0)*math.pi/180.0)-2.67 for th in theta] + y = [2.57*math.sin((th+9.0)*math.pi/180.0)-0.2 for th in theta] + VECTOR = [theta[i], x[i], y[i]] for i in range(len(theta))] + vscan(writables, SENSORS, VECTOR, True, LATENCY, False, before_read=before_readout, after_read = after_readout) + + # Mn + Scienta.getLowEnergy().write(175.0) + Scienta.getHighEnergy().write(235.0) + Scienta.getStepSize().write(0.1) + Scienta.getStepTime().write(1.0) + Scienta.setIterations(8) + Eph.move(860.0) + + theta = [-9.0,6.0,21.0,31.0,41.0,51.0,61.0,71.0] + x = [2.57*math.cos((th+9.0)*math.pi/180.0)-2.67 for th in theta] + y = [2.57*math.sin((th+9.0)*math.pi/180.0)-0.2 for th in theta] + VECTOR = [theta[i], x[i], y[i]] for i in range(len(theta))] + vscan(writables, SENSORS, VECTOR, True, LATENCY, False, before_read=before_readout, after_read = after_readout) +finally: + after_scan()