This commit is contained in:
gac-x05la
2021-05-20 15:42:59 +02:00
parent 6f30d641d3
commit 2a65e100ea
13 changed files with 1124 additions and 15 deletions
@@ -0,0 +1,64 @@
#Script imported from: 201812041240_VERSI_pinholescan.xml
#Pre-actions
caput('X05LA-ES3:SET-DCT-TIME', '1.0')
sleep(0.01)
caput('X05LA-ES3:SMPL-BTN', '1')
#TODO: Set the diplay names of positioners and detectors
scan = ManualScan(['TRY', 'TRX'], ['SAI_07', 'SAI_05'] , [-0.2, -0.2], [0.2, 0.2], [20, 20])
scan.start()
#Creating channels: dimension 1
#LinearPositioner TRY
TRY = Channel('X05LA-ES2-VERSI:TRYUP', type = 'd')
TRYReadback = Channel('X05LA-ES2-VERSI:TRYUP.RBV', type = 'd')
#Creating channels: dimension 2
#LinearPositioner TRX
TRX = Channel('X05LA-ES2-VERSI:TRXUP', type = 'd')
TRXReadback = Channel('X05LA-ES2-VERSI:TRXUP.RBV', type = 'd')
#ScalarDetector SAI_07
SAI_07 = Channel('X05LA-ES3:SAI_07', type = 'd')
#ScalarDetector SAI_05
SAI_05 = Channel('X05LA-ES3:SAI_05', type = 'd')
#Dimension 1
#LinearPositioner TRY
for setpoint1 in frange(-0.2, 0.2, 0.02, True):
if setpoint1 > 0.2 or setpoint1 < -0.2:
break
TRY.put(setpoint1, timeout=None) # TODO: Set appropriate timeout
readback1 = TRYReadback.get()
if abs(readback1 - setpoint1) > 0.01 : # TODO: Check accuracy
raise Exception('Actor TRY could not be set to the value ' + str(setpoint1))
#Dimension 2
#LinearPositioner TRX
for setpoint2 in frange(-0.2, 0.2, 0.02, True):
if setpoint2 > 0.2 or setpoint2 < -0.2:
break
TRX.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
readback2 = TRXReadback.get()
if abs(readback2 - setpoint2) > 0.01 : # TODO: Check accuracy
raise Exception('Actor TRX could not be set to the value ' + str(setpoint2))
sleep( 0.1 ) # Settling time
#Detector SAI_07
detector1 = SAI_07.get()
#Detector SAI_05
detector2 = SAI_05.get()
scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2])
#Closing channels
TRX.close()
TRXReadback.close()
SAI_07.close()
SAI_05.close()
TRY.close()
TRYReadback.close()
scan.end()
#Post-actions
caput('X05LA-ES2-VERSI:TRXUP', '0.0')
sleep(0.5)
caput('X05LA-ES2-VERSI:TRYUP', '0.0')
sleep(0.5)