Closedown
This commit is contained in:
@@ -23,6 +23,14 @@ public class Pilatus extends AreaDetector{
|
||||
return (Double) readCtrl("Chi", Double.class);
|
||||
}
|
||||
|
||||
public void setChiIncr(double value) throws IOException, InterruptedException{
|
||||
writeCtrl("ChiIncr", value);
|
||||
}
|
||||
|
||||
public double getChiIncr() throws IOException, InterruptedException{
|
||||
return (Double) readCtrl("ChiIncr", Double.class);
|
||||
}
|
||||
|
||||
public void setOmega(double value) throws IOException, InterruptedException{
|
||||
writeCtrl("Omega", value);
|
||||
}
|
||||
|
||||
+61
-93
@@ -1,9 +1,5 @@
|
||||
# CHECKLIST FIRST
|
||||
# sleep 2400
|
||||
startphi=-60
|
||||
endphi=120 # for DACs the middle is 57
|
||||
#startom=-34.9
|
||||
#endom=40.1
|
||||
time_step=4
|
||||
step=0.5 # in degrees
|
||||
#fname='testing'
|
||||
@@ -11,110 +7,82 @@ fname='MRc_01' # remember the run number
|
||||
|
||||
|
||||
|
||||
#TODO: Should not move to startphi?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#stepb=-0.5 # needed for the way back
|
||||
#fnameb='CuBrPyz_6p3_04' # needed for the way back
|
||||
|
||||
|
||||
filters=`caget -prec 16 X04SA-ES2-FI:TRANSM | cut -c20-36`
|
||||
filt=`echo $filters '*1000000000'|bc`
|
||||
echo $filt ' is the new value'
|
||||
caput X04SA-ES2-PIL:cam1:FilterTransm $filt
|
||||
|
||||
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)
|
||||
|
||||
|
||||
## THE FOLLOWING LINES IMPLEMENT AND CALCULATE SEVERAL PARAMETERS
|
||||
time=`echo $time_step '-0.003' | bc` # calculates Exposure time
|
||||
phitot=`echo $endphi '-' $startphi | bc` # calculates total omega span
|
||||
images=`echo $phitot '/' $step|bc` # calculates number of images
|
||||
step10000=`echo $step '*10000'|bc` # shell does not like floating
|
||||
echo $step10000 ' step10000'
|
||||
velo10000=`echo $step10000 '/' $time_step|bc` # "
|
||||
velo=`echo $velo10000 '*0.0001'|bc` # calculates real angular velocity
|
||||
check=`expr $velo10000 / 50001` # creates a check for max velocity
|
||||
if [ $check = 0 ]
|
||||
then
|
||||
caput X04SA-ES2-SCD:ROY.VELO $velo # speed of the omega axis in deg/s
|
||||
tottim=`echo $time_step '*' $images|bc` # calculates total time needed
|
||||
tottime=`echo $tottim '+5'|bc` # adds 5 for safety
|
||||
echo 'total time is '$tottime
|
||||
echo 'now collecting '$fname
|
||||
exp_time = time_step -0.003 # calculates Exposure time
|
||||
phitot = endphi - startphi # calculates total omega span
|
||||
images = phitot/step # calculates number of images
|
||||
step10000 = 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:
|
||||
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
|
||||
print "Total time: ", tottime
|
||||
print "Collecting ", fname, "..."
|
||||
|
||||
# THE FOLLOWING LINES SEND COMMANDS TO THE CAMSERVER
|
||||
caput X04SA-ES2-PIL:cam1:NumImages $images # number of images
|
||||
caput X04SA-ES2-PIL:cam1:AcquireTime $time # Exposure time
|
||||
caput X04SA-ES2-PIL:cam1:AcquirePeriod $time_step # Acquire period
|
||||
det.numImages = images # number of images
|
||||
det.acquireTime = exp_time # Exposure time
|
||||
det.acquirePeriod = time_step # Acquire period
|
||||
|
||||
|
||||
### FORWARD ###
|
||||
# PLEASE NOTE THE FOLLOWING HAS NOT YET BEEN UPDATED FOR AUTOMATIC ANGLES
|
||||
caputq X04SA-ES2-PIL:cam1:Phi $startphi
|
||||
caputq X04SA-ES2-PIL:cam1:PhiIncr $step
|
||||
caputq X04SA-ES2-PIL:cam1:Chi 90
|
||||
caputq X04SA-ES2-PIL:cam1:ChiIncr 0.0
|
||||
caputq X04SA-ES2-PIL:cam1:Omega 57.05 # initial angle
|
||||
caputq X04SA-ES2-PIL:cam1:StartAngle $startphi # might be redundant
|
||||
caputq X04SA-ES2-PIL:cam1:OmegaIncr 0.0 # increment angle
|
||||
caputq X04SA-ES2-PIL:cam1:AngleIncr $step # might be redundant
|
||||
caputq X04SA-ES2-PIL:cam1:Kappa -134.76 # kappa
|
||||
caputq X04SA-ES2-PIL:cam1:Phi 57.045 # phi
|
||||
det.phiIncr = step
|
||||
det.chi = 90
|
||||
det.chiIncr = 0.0
|
||||
det.omega = 57.05 # initial angle
|
||||
det.startAngle = startphi # might be redundant
|
||||
det.omegaIncr = 0.0 # increment angle
|
||||
det.angleIncr = step # might be redundant
|
||||
det.kappa = -134.76 # kappa
|
||||
det.phi = 57.045 # phi
|
||||
|
||||
# PREPARE AND ACQUIRE
|
||||
caputq X04SA-ES2-PIL:cam1:FileNumber 1 # always start with image 1
|
||||
sleep 1
|
||||
caputq X04SA-ES2-PIL:cam1:FileName $fname # filename
|
||||
sleep 1
|
||||
caputq X04SA-ES2-SCD:ROY.VAL $endphi & # move the axis to ...
|
||||
caputq X04SA-ES2-PIL:cam1:Acquire 1
|
||||
sleep $tottime
|
||||
det.fileNumber = 1 # always start with image 1
|
||||
sleep (1.0)
|
||||
det.fileName =fname # filename
|
||||
sleep (1.0)
|
||||
#scr.move(endphi) # move the axis to ...
|
||||
det.start()
|
||||
sleep(tottime)
|
||||
|
||||
|
||||
### BACKWARD ###
|
||||
# PLEASE NOTE THE FOLLOWING HAS NOT YET BEEN UPDATED FOR AUTOMATIC ANGLES
|
||||
#caputq X04SA-ES2-PIL:cam1:Phi $endphi
|
||||
#caputq X04SA-ES2-PIL:cam1:PhiIncr $stepb
|
||||
#caputq X04SA-ES2-PIL:cam1:Chi 90
|
||||
#caputq X04SA-ES2-PIL:cam1:ChiIncr 0.0
|
||||
#caputq X04SA-ES2-PIL:cam1:Omega 57.05 # initial angle
|
||||
#caputq X04SA-ES2-PIL:cam1:StartAngle $endphi # might be redundant
|
||||
#caputq X04SA-ES2-PIL:cam1:OmegaIncr 0.0 # increment angle
|
||||
#caputq X04SA-ES2-PIL:cam1:AngleIncr $stepb # might be redundant
|
||||
#caputq X04SA-ES2-PIL:cam1:Kappa -134.76 # kappa
|
||||
#caputq X04SA-ES2-PIL:cam1:Phi 57.045 # phi
|
||||
#det.phiIncr = $stepb
|
||||
#det.chi = 90
|
||||
#det.chiIncr = 0.0
|
||||
#det.omega = 57.05 # initial angle
|
||||
#det.startAngle = endphi # might be redundant
|
||||
#det.omegaIncr = 0.0 # increment angle
|
||||
#det.angleIncr = stepb # might be redundant
|
||||
#det.kappa = -134.76 # kappa
|
||||
#det.phi = 57.045 # phi
|
||||
|
||||
## PREPARE AND ACQUIRE
|
||||
#caputq X04SA-ES2-PIL:cam1:FileNumber 1 # always start with image 1
|
||||
#sleep 1
|
||||
#caputq X04SA-ES2-PIL:cam1:FileName $fnameb # filename
|
||||
#sleep 1
|
||||
#caputq X04SA-ES2-SCD:ROY.VAL $startphi & # move the axis to ...
|
||||
#caputq X04SA-ES2-PIL:cam1:Acquire 1
|
||||
#sleep $tottime
|
||||
#det.fileNumber = 1 # always start with image 1
|
||||
#sleep (1.0)
|
||||
#det.fileName =fnameb # filename
|
||||
#sleep (1.0)
|
||||
#scr.move(startphi) # move the axis to ...
|
||||
#det.start()
|
||||
#sleep(tottime)
|
||||
|
||||
|
||||
caputq X04SA-ES2-SCD:ROY.VELO 5.0
|
||||
sleep 1
|
||||
caputq X04SA-ES2-SCD:ROY.VAL $startphi
|
||||
sleep 16
|
||||
scr.setSpeed 5.0
|
||||
sleep(1.0)
|
||||
#scr.move(startphi)
|
||||
sleep(16.0)
|
||||
|
||||
# THIS IS IN CASE THE MAX VELOCITY IS EXCEEDED
|
||||
else
|
||||
echo ''
|
||||
echo 'WARNING'
|
||||
echo 'too fast velocity calculated for the motor, please change'
|
||||
echo ''
|
||||
fi
|
||||
Reference in New Issue
Block a user