esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

cen.mac
See other macros in category: Scans Obsolete
Description:
    Centering macros. OBSOLETE.
Documentation:
    DESCRIPTION
    This macro set is OBSOLETE. Kept here as example This set of macros will try to find the center of a reflection in the angle sequence specified by the user. It will do a scan in the first angle, go to the center of the peak found, do a scan in the next angle, and so on. Initially it takes a user supplied scan width, but after the first cycle, it adjusts the scan width depending on FWHM found. The sequence is repeated until either convergence or a max number of cycles is found.
    This routine can be used in conjunction with the SEARCH routine, either directly inside, or from the search results file.

    EXAMPLE
      cen_seq
        Defines the centering sequence -  Angle names and convergence criteria
         Angle number 1
           Name?: [ 0 to end]:  (0)? th 
           Give data for: th
            Initial scan width: (1)? 1.5
            Initial scan step size:  (0)? .1
            Minimum step size: (0)? 0.05
            Max shift to define convergence:  (0)? 0.02
            Recenter if already converged (NO)? YES 
         Angle number 2
           Name?: [ 0 to end]:  (0)? chi
           Give data for: chi
            Initial scan width: (3)? 6
            Initial scan step size:  (0)? .25
            Minimum step size: (0)? .2
            Max shift to define convergence:  (0)? .05
            Recenter if already converged (NO)? YES
         Angle number 3
           Name?: [ 0 to end]:  (0)? 0
        2 angles in sequence -  th chi
      cen_here
        The centering will start from the current angles.
     


    ATTENTION


    DEPENDENCIES
    - The file cen.mac has to be read in (qdo'd) !done by: startup script

Macros:
    cen_seq
    Usage: cen_seq
    You will be ask the filename for results and other general paramters (see cen_par ). For every angle you like to center you have to answer the following questions:
    • Name?: [ 0 to end] : Enter the motor mnemonic
    • Initial scan width :
    • Initial scan step size : Just give enough to be sure not to miss your peak. The step width will be adjusted for the consecutive scans.
    • Minimum step size : A scan will not be made with smaller step size even if you ask for more points in the scan (see general setup)
    • Max shift to define convergence
    • Recenter if already converged : NO will stop doing scans with this motor if it is converged. YES will recenter this angle even if it is converged. (ex: the angles dependent on each other).


    cen_here
    Usage: cen_here
    This initiates the centering algorithm from current angles\n")

Internal Macros:
    cen_do_it
    Usage: cen_do_it
    This routine does the real centering

    cen_what_next
    Usage: cen_what_next
    decides whether to give up (maxc < CENMINC), scan further, or prepares the next angles.

    cen_scan
    Usage: cen_scan <center-angle-index>


    cen_par
    Usage: cen_par
        Number of points in the scan : 15
        Maximum number of cycles allowed :5 
        Initial counting time in secs :1
        Max permitted counting time :10  (not implemented yet)
        Minimum counts to define a peak :200 (better will be a peak/bkgd ratio)
    


    cen_defaults
    Usage: cen_defaults
    Sets defaults for angles to write, output format ,... This is done in this way to allow other macros to use the centering for more general scans (like beamline alignment)

    cen_mv
    Usage: cen_mv
    does the moving in the centering - uses the BESTANG array

    cen_savetofile
    Usage: cen_savetofile
    This macro saves the results to a file. This has been separated to allow other macro sets to redefine it.

Filename: cen.mac
Author: JA 1st trimestre .94 , modified by JK (6.94)
Last mod.: 27/02/2008 14:19 by rey