From 520bb6235a7ab0553238be92fdd601397ecaa77e Mon Sep 17 00:00:00 2001 From: gac-x04sa Date: Fri, 12 Jan 2018 15:18:10 +0100 Subject: [PATCH] Closedown --- script/scans/6mom.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/script/scans/6mom.py b/script/scans/6mom.py index b5b69e3..ff09af7 100644 --- a/script/scans/6mom.py +++ b/script/scans/6mom.py @@ -6,27 +6,20 @@ step=0.5 # in degrees fname='MRc_01' # remember the run number - #TODO: Should not move to startphi? filt=caget("X04SA-ES2-FI:TRANSM",'d') *1000000000 #TODO:Check if wtiting 1000000000.00000000000000 or 1.0E9 is equivalent -#caput("X04SA-ES2-PIL:cam1:FilterTransm",filt) +caput("X04SA-ES2-PIL:cam1:FilterTransm",filt) -## THE FOLLOWING LINES IMPLEMENT AND CALCULATE SEVERAL PARAMETERS exp_time = time_step -0.003 # calculates Exposure time phitot = endphi - startphi # calculates total omega span -images = int(phitot/step) # calculates number of images #TODO: floor or ceil? -step10000 = int(step *10000) # shell does not like floating -velo10000 = step10000 / time_step # " -velo = velo10000 *0.0001 # calculates real angular velocity -check = velo10000 / 50001 # creates a check for max velocity - -if check!=0: +images = int(phitot/step) # calculates number of images #TODO: floor or ceil? +velo = float(step)/time_step +if velo > 5.0: raise Exception("Too fast velocity calculated for the motor, please change") scr.setSpeed(velo) # speed of the omega axis in deg/s -tottim = time_step * images # calculates total time needed -tottime = tottim + 5 # adds 5 for safety +tottime = time_step * images + 5 # calculates total time needed, adds 5 for safety print "Total time: ", tottime print "Collecting ", fname, "..." @@ -50,11 +43,13 @@ det.phi = 57.045 # phi # PREPARE AND ACQUIRE det.fileNumber = 1 # always start with image 1 -sleep (1.0) +sleep (1.0) #TODO: Why needed if another sleep below det.fileName =fname # filename sleep (1.0) -#scr.move(endphi) # move the axis to ... +scr.moveAsync(endphi) det.start() + +#scr.waitReady(tottime * 1000) #TODO: Should sleep or wait end of move? sleep(tottime) @@ -81,7 +76,7 @@ sleep(tottime) scr.setSpeed (5.0) -sleep(1.0) -#scr.move(startphi) -sleep(16.0) +#sleep(1.0) #TODO: Using device this is not needed +scr.move(startphi, 20000) +#sleep(16.0) #TODO: Sync move, this is not needed