From c5fd22e63587abc1a9f4b834844f8814a38c7e56 Mon Sep 17 00:00:00 2001 From: x07maop Date: Mon, 24 Aug 2015 10:27:47 +0200 Subject: [PATCH] Script execution --- script/HystScan.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/script/HystScan.py b/script/HystScan.py index fd23681..afd1862 100644 --- a/script/HystScan.py +++ b/script/HystScan.py @@ -1,21 +1,21 @@ #Script imported from: Fe_hyst_plus.xml #Parameters -""" -START_FIELD = -0.2 -END_FIELD = 0.2 + +START_FIELD = -0.1 +END_FIELD = 0.1 ENERGIES = (707.90, 703.90) -RAMP_RATE = 2.0 +RAMP_RATE = 0.2 ENERGY_CHANGE_SLEEP = 0.5 -""" + #Pre-actions -#cawait('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's') -#caput('X07MA-ID:MODE', 'CIRC +') +cawait('ACOAU-ACCU:OP-MODE', 'Light Available', type = 's') +aput('X07MA-ID:MODE', 'CIRC +') sleep(1.0) -#cawait('X07MA-ID:DONE', 'DONE', type = 's') -#caput('X07MA-ID:ENERGY-OFFS', '-1.0') -#cawait('X07MA-ID:DONE', 'DONE', type = 's') +cawait('X07MA-ID:DONE', 'DONE', type = 's') +caput('X07MA-ID:ENERGY-OFFS', '-1.0') +cawait('X07MA-ID:DONE', 'DONE', type = 's') caputq('X07MA-PC:CSCALER.INPB', '1') caputq('X07MA-PC-PS2:SET:DMD:RAMPRATE:TPM', RAMP_RATE) #sleep(15.0) @@ -41,8 +41,8 @@ ramp_done = Channel('X07MA-PC-MAG:X:RAMP:DONE', type = 'i') fieldReadback = Channel('X07MA-PC-PS2:STS:PMCURRENT', type = 'd') #Creating channels: dimension 2 #ArrayPositioner Energy -Energy = sim_energy #Channel('X07MA-PHS-E:GO.A', type = 'd') -EnergyReadback = sim_energy_readback # Channel('X07MA-PGM:CERBK', type = 'd') +Energy = Channel('X07MA-PHS-E:GO.A', type = 'd') +EnergyReadback = Channel('X07MA-PGM:CERBK', type = 'd') #ScalarDetector TEY TEY = Channel('X07MA-ES1-AI:SIGNAL0', type = 'd') #ScalarDetector I0 @@ -50,9 +50,9 @@ I0 = Channel('X07MA-ES1-AI:SIGNAL1', type = 'd') #ScalarDetector trans trans = Channel('X07MA-ES1-AI:SIGNAL2', type = 'd') #ScalarDetector polarization -#polarization = Channel('X07MA-ID:MODE', type = 'd') +polarization = Channel('X07MA-ID:MODE', type = 'd') #ScalarDetector polAngle -#polAngle = Channel('X07MA-ID:ALPHA', type = 'd') +polAngle = Channel('X07MA-ID:ALPHA', type = 'd') #ScalarDetector temperature temperature = Channel('X07MA-PC-TC:STS:T1', type = 'd') #ScalarDetector RingCurrent @@ -62,13 +62,13 @@ fieldAnalogX = Channel('X07MA-ES1-AI:SIGNAL4', type = 'd') print "Waiting for start field" -""" + #WORKAROUND TO BUG IN DRIVER if abs(fieldReadback.get() - START_FIELD) < 0.005: caput('X07MA-PC-PS2:M:GO.A', START_FIELD + 0.01) caput('X07MA-PC-PS2:M:GO.A', START_FIELD) #caputq('X07MA-PC-PS2:M:GO.A', START_FIELD) -""" + caput("X07MA-PC-MAG:X:DMD", START_FIELD) caput("X07MA-PC-MAG:STARTRAMP.PROC", 1) @@ -100,9 +100,9 @@ while(True): #Detector trans detector3 = trans.get() #Detector polarization - detector4 = sim_energy_readback.read() # polarization.get() + detector4 = polarization.get() #Detector polAngle - detector5 = sim_energy_readback.read() #polAngle.get() + detector5 = polAngle.get() #Detector temperature detector6 = temperature.get() #Detector RingCurrent @@ -148,8 +148,8 @@ EnergyReadback.close() TEY.close() I0.close() trans.close() -#polarization.close() -#polAngle.close() +polarization.close() +polAngle.close() temperature.close() RingCurrent.close() fieldAnalogX.close()