esrf

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

CSCAN.MAC
See other macros in category: Scans
Description:
    Continuous 1- and 2-dimensional scans
Documentation:
    DESCRIPTION
    This macro set provides the possibility to execute continuous scans with one or two motors. During these scans peaks can be searched.

    OVERVIEW
    The following macros are provided:
    cscan
    to scan one motor continuously with a defined speed.
    c2scan
    to scan two motors continuously with a defined speed.
    cmesh
    to execute a mesh scan where one of the motors is scanned continuously with a defined speed.
    cscansetup
    to set options for the previous macros, like saving the results or searching for peaks.


    EXAMPLE
    cscansetup
    Allows to chose the options for the macros cscan and cmesh and asks the following questions:
     Do you want to save (NO)? yes
     Do you want to plot (YES)? 
     Plotting (Only for cmesh)
       1: every slice
       2: the whole scan (1)? 
     Count unit for plotting and peaksearch:
       1: Counts
       2: Counts/s
       3: Counts/Monitor counts (2)? 
     Peaksearch
       0 : No peaksearch
       1 : Maximal Counts/s bigger than threshold (1)? 
           Threshold in Counts/s (1000)? 
    
    cscan m0 80 85 1 0.5
    Scans the motor m0 continuously from 80 to 85. The moving speed is 1 degrees/minute and the sleeptime is 0.5 seconds.
    c2scan m0 16 17 5 m1 5 5.5 0
    Scans motor m0 continuously from 16 to 17 and motor m1 continuously from 5 to 5.5. The moving speed of motor m0 is 5 degrees/minute. The speed of motor m1 is automatically set to 2.50 degrees/minute so that the motors arrive both at the same time.
    cmesh m0 80 85 1 m1 70 80 10 1
    Executes the following mesh scan: The motor m1 is moved in 10 intervals from 80 to 90. For every point of m1, m0 is moved with the speed 1 degree/minute from 80 to 85 or vice-versa.


    ATTENTION
    Before the first use of cscan or cmesh, you have to execute the macros plotconfig, plotselect and cscansetup.

Macros:
    cscan
    Usage: cscan <motor> <start> <stop> <speed> [sleeptime]
    Scans motor continuously from start to stop. During the scan the moving speed is set to speed. Is 0 given as the moving speed, the actual moving speed isn't changed. If the parameter sleeptime isn't specified, the sleeptime is 0.
    It is possible to search for peaks during the scan (see cscansetup).



    c2scan
    Usage: c2scan <m1> <s1> <f1> <speed1> <m2> <s2> <f2> <speed2> [sleeptime]
    As cscan but two motors are scanned continously. If one of the moving speeds is 0, the second one is calculated that manner, that both motors arrive at the same time. If both are omitted the current moving speeds are kept. If the parameter sleeptime isn't specified, the sleeptime is 0.
    It is possible to search for peaks during the scan (see cscansetup).



    cmesh
    Usage: cmesh <m1> <s1> <f1> <speed> <m2> <s2> <f2> <intervals> [sleeptime]
    Traces out a grid using the motors m1 and m2. The first motor scans continuously with the moving speed speed from s1 to e1 while the second one scans from s2 to f2 using the specified number of intervals: The scan of m1 is done at each point scanned by m2. That is, the first motor scan is nested within the second motor scan. If the parameter sleeptime isn't specified, the sleeptime is 0.
    It is possible to to search for peaks during the scan (see cscansetup).



    cscansetup
    Usage: cscansetup
    Defines options for the macros cscan and cmesh. You will be asked the following questions:
      Do you want to save (NO)? 
    
    It is possible to save the results.
      Do you want to plot (YES)? 
    
    You can plot the results.
      Plotting (Only for cmesh)
        1 : for every slice
        2 : for the whole scan (2)? 
    
    If you chose the first option one slice is plotted after the other, otherwise all slices are plotted in the same graph.
      Count unit for plotting and peaksearch:
        1: Counts
        2: Counts/s
        3: Counts/Monitor counts (2)? 
    
    You can specify if you want to plot Counts, Counts/s or Counts/Monitor counts. This selection is also used for the peaksearch.
      Peaksearch
        0 : No peaksearch
        1 : Maximal counts/s bigger than threshold (1)? 
            Threshold in counts/s (0)? 
    
    You can execute a peaksearch over the scan results, in this case you have to give the minimal value (threshold) for a peak.

Internal Macros:
    _cscan_check
    Usage: _cscan_check
    Parameter check for the macros cscan, c2scan and cmesh

    _cscan_init
    Usage: _cscan_init
    Initialisations for the macros cscan and c2scan

    _cmesh_init
    Usage: _cmesh_init
    Initialisations for the macro cmesh

    _cscan_init_group1
    Usage: _cscan_init_group1
    Initialisation of the group used for plotting and peaksearching: Tests if the group has enough points to plot the probably needed number of points. If more points are needed than available, a data reduction factor is calculated (e.g. only every second point is taken into account for plotting and peaksearching).
    This data reduction doesn't concern the data which is saved. Every data point is saved.

    _cscan_end
    Usage: _cscan_end
    Cleanup macro which is called after a normal end of the macros cscan und cmesh.

    _cscan_cleanup
    Usage: _cscan_cleanup
    Cleanup macro which is called in the case of the abort of cscan or cmesh with Ctrl-C: Closes the datafile and resets the old speed.

    _cscan_set_speed
    Usage: _cscan_set_speed
    Sets the new speed for the continuous scan.

    _cscan_unset_speed
    Usage: _cscan_unset_speed
    Resets the old speed.

    _cscan
    Usage: _cscan <motor> <to>
    Execution of the continuous scan of motor motor to the position to.

    _cmesh
    Usage: _cmesh
    Execution of the 2d grid scan with one motor moving continuously.

    _cscan_get_first_point
    Usage: _cscan_get_first_point
    Gets the first point (only the motor position)

    _cscan_get_point
    Usage: _cscan_get_point
    Gets data of one point in the data group.

    _cscan_peak1
    Usage: _cscan_peak1
    Peaksearch for one slice.

    _cscan_display_peak
    Usage: _cscan_display_peak <peak> <motorpos at max>
    Displays a peak (in the plot window and in spec).

    _cscan_display_no_peak
    Usage: _cscan_display_no_peak
    Displays that there is no peak (in the plot window and in spec).

    _cscan_plot_point
    Usage: _cscan_plot_point
    Plots one point.

    _cscan_save_header
    Usage: _cscan_save_header
    Writes the scan header to the data file.

    _cscan_save_point
    Usage: _cscan_save_point
    Writes the scan data of one point to the data file.

    _reset_CSC_LAST_CNT
    Usage: _reset_CSC_LAST_CNT


Filename: cscan.mac
Author: Elke Raabe, 12.9
Last mod.: 30/04/2013 16:40 by claustre