#########################################
# dmacros - macros for MedOptics at G3 #
######## ds 7/07 ########################

#
# plotting aliases
#
def laser 'plotlast'
def llaser 'logplotlast'

#
# where macros
#
def wdiff 'wm mu zeta del chamy samz gam att'

#
# equipment safety check for new sample
#
def new '{
   if(!yesno("is the ccd covered",0)) exit
   if(!yesno("is the lead mask removed",0)) exit
   if(!yesno("is the ion chamber and the slit in place",0)) exit
   ccdoff
   newfile
   mv mu 0 zeta 0 chamy -1 att 3
   dscan gam -1 1 20 1; mv gam CEN; set gam 0
   dscan del -1 1 20 1; mv del CEN; set del 0
}'

#
# line-up macros
#
def rock '{
   mv chamy 0; dscan chamy -1 1 20 1; mv chamy CEN; set chamy 0
   dscan zeta -1 1 20 1; mv zeta CEN; set zeta 0
}'

def refl '{
  mv mu 0.3 zeta -0.15
  dscan zeta -.2 .2 20 1; mv zeta CEN; set zeta 0.15; laser
  dscan chamy -1 1 20 1; mv chamy PEAK; laser
}'