Macro for sample motor corrections

From CNM Wiki
Revision as of 18:51, April 14, 2009 by Vrose (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to X-Ray Microscopy


def sxm_config (mne,type,unit,module,chan) ' {

   if (type == "mot" )
         return "sxm sym szm soxm stxm suxm"

}'

def sxm_calc(mne,mode) ' {

   if (mode == 0 ) {
       if (mne == th)
           A[mne] =atan((A[suxm]-3.5)/41.326)*180/PI;
       else if (mne == chi)
           A[mne] =atan((A[stxm]-3.5)/41.326)*180/PI;
       else if (mne == sx)
           A[mne] = A[sxm]-(41.326+25.0)*sin(atan((A[suxm]-3.5)/41.326))-15.0*sin(atan((A[stxm]-3.5)/41.326));
       else if (mne == sy)
           A[mne] = A[sym]-13.0*sin(atan((A[stxm]-3.5)/41.326));
       else if (mne == szc)
           A[mne] = A[szm]+13.0*sin(atan((A[suxm]-3.5)/41.326));
   }	       
   else {
       if (mne == sxm )
           A[mne] = A[sx]+(41.326+25.0)*sin(A[th]*PI/180)+15.0*sin(A[chi]*PI/180);
       else if (mne == sym )
           A[mne] = A[sy]+13*sin(A[chi]*PI/180);

else if (mne == szm )

           A[mne] = A[szc]-13.0*sin(A[th]*PI/180);

else if (mne == stxm )

           A[mne] = 3.5+41.326*tan(A[chi]*PI/180);

else if (mne == suxm )

           A[mne] = 3.5+41.326*tan(A[th]*PI/180);
   }

}'