""" 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()