# stepscan.mac (c) Petr Mikulik # What is it: step scans, i.e. scans with step specified # For use at: any beamline # Version: 22.11.2002 # History: # 22.11.2002: (+0.5) in nb of points # 26.6.2000: clean up # 12.10.1998: update # 4.10.1996: pst_2Qwmap.mac # # Definitions of: # stepscan # step2scan ############################################################################### ############################## stepscan ###################################### ############################################################################### # Like ascan, but uses step instead of number of intervals # parameters required - like for ascan: # motor from to step counting_time def stepscan ' { local xfrom xto xstep if ($#!=5) { p "\n # Usage: motor from to step counting_time\a\n" exit } if ($4==0) { p "\a\nStep cannot be zero!\n" exit } if ($2==$3) { # scan with zero points - spec makes exit ! ond ct $5 offd } else { if ($2==0) xfrom = 0 else xfrom = $2 xstep = $4 if ($3==0) xto = 0 else xto = xfrom + xstep * int((($3)-xfrom)/xstep+0.5) ascan $1 xfrom xto fabs(int(0.5+(xto-xfrom)/xstep)) $5 } }' ############################################################################### ############################## step2scan ##################################### ############################################################################### # Parameters required: like for a2scan # motor1 from1 to1 step1 motor2 from2 to2 counting_time def step2scan ' if ($#!=8) { p "\n # Usage: motor1 from1 to1 step1 motor2 from2 to2 counting_time\a\n" exit } p "Doing: "a2scan $1 $2 $3 $5 $6 $7 int(($3-$2)/$4)+1 $8 a2scan $1 $2 $3 $5 $6 $7 fabs(int(0.5+($3-$2)/$4)) $8 ' # eof stepscan.mac