Scan/Center

The optimization of motor positions by searching the maximum intensity is supported by a menu.

ONLINE> SCAN/CEN*TER
[/M1=motor_name]
[/M2=motor_name]
[/M3=motor_name]
[/M4=motor_name]

The following qualifiers may be supplied by the user:

 /COA*RSE
There is no refinement of the scan range.

 /EXEC*UTE
The centering starts immediately. Control is not passed to the menu driver.

 /NODIS*PLAY
Suppresses any graphical output. Most likely this is used in the /EXEC mode.

 /NOBA*CKGROUND_SUBTRACTION
Suppresses the subtraction of the background during the determination of the peak.

 /_AUTO_FILTER=1_or_0
 /_CENTERING_M*ODE=int_expr
 /_CENTERING_ORDER=text_expr
 /_NP_SCAN=int_expr The number of scan points.
 /_RANGE_M$i$=val
 /_SCAN_NAME=val (Def.: CENTER_)
The initial values of the scan parameters.

The command

ONLINE> scan/center/m1=mot1/m2=mot2
invokes a menu, that is displayed below (table 7.7).


Table 7.6: The scan/center Menu
 

                            --- CENTER MENU ---
  SPECTRA>   |                                                            |
                    M1           M2             M3            M4
                    MOT30        MOT31          MOT34         MOT35
  Alias             DIFF_TWO_THE SP_OM, DIFF_   DIFF_CHI, SP  DIFF_PHI, SP
  Move to
  Position          54.2553       27.03157      56.35913      -82.74393
-------------------------------------------------------------------------------
  Signal            536           Cent. Order  1234
  C. Mode           Max Y         Auto Filter  NO
-------------------------------------------------------------------------------
  Scan Range        1.457412      1.55285       0.949733      1.351935
  No. of points     21
  Conv. Ratio       0.01
  Iterations        1
-------------------------------------------------------------------------------
  Peak Pos.         54.25531      27.03159      56.35914      -82.74393
  FWHM              0.728706      0.776425      0.474866      0.675967



-------------------------------------------------------------------------------
 PF1 - Start Cent. | PF3 - Calibrate     | PF4 - Exit         | KP7 - M1 Scan
 KP9 - M2 Scan     | KP_MINUS - M3 Scan  | KP5 - M4 Scan      |


Here is the description of the menu items:

 SPECTRA>
The input field for a SPECTRA command.

 M$i$
The motor names and aliases. An alias is a symbol that translates to a motor name.

 Move to:
Destinations for movements are specified in absolute units. Movements are started by pressing the <ret> key.

 SIGNAL
Is updated whenever the menu is displayed. It is determined by evaluating the symbol SIGNAL which has been defined in EXP_INI.EXP, e.g.: SIGNAL = [vfc(c1, t1, 0.2)]. SIGNAL is the contents of counter C1 after timer T1 has opened the gate for 0.2 seconds. SIGNAL is used for the optimization of the motor positions.

 Cent. Order
Determines the optimization sequence, e.g: '12' means that first M1 is optimized, followed by M2.

 Mode
The definition of the maximum:
CMS
The average x-value.
Max Y
The point with the highest y-value.
Midpoint
The center between those points where the signal is at the 50% level of the maximum.
A simple background subtraction is done for all three cases: The first $nbg$ points of the scans are averaged and also the last $nbg$ points. The straight line which connects both averaged y-values is assumed to represent the background contribution. $nbg$ is 10% of the number of data points or 2, if the number of data points is below 10.

 AUTO_FILTER
If enabled, SPECTRA tries to keep the SIGNAL between FILTER_MIN and FILTER_MAX by moving an attenuator in steps of FILTER_DELTA. The symbols FILTER_MIN, FILTER_MAX and FILTER_DELTA should be defined in EXP_INI.EXP.

 Scan range
A scan range of 2 means current positions $\pm$ 1.

 No. of Points
The number of points for a scan.

 Conv. Ratio
A quantity that defines the convergence. After ONLINE performed a motor scan, it compares the maximum with the previous position. If $abs(old-new)/range < Conv. Ratio$, the centering is terminated.

 Peak pos and FWHM
The results.

The description of the PF keys:

 PF1
Start centering: ONLINE performs scans to find the maximum intensity. The order in which the motors are moved is determined by the symbol CENTERING_ORDER.

Every motor undergoes a coarse scan first. The coarse scan is used to determine the scan range (2$\times$FWHM). If the fine scan range is less than 50% of the old one, ONLINE repeats the scan before it moves the next motor.

If the signal does not go down to half of the maximum. ONLINE informs the user that it is not able to determine the width:" FIND_MAX failed to determine the new width, continue? ". In case the user responds with "Y", the range is doubled and the program continues. Otherwise an error is generated which causes the centering routine to terminate.

The maximum of a scan is found be calculating the center of gravity, the midpoint or by taking the highest y-value.

If the scans pass the convergence test, the program terminates. Otherwise the fine scans are repeated ITERATIONS times.

 PF4 (Ctrl-X)
Exit this menu.
 KP7
M1 Scan
 KP9
M2 Scan
 KP_MINUS
M3 Scan
 KP5
M4 Scan

The function gra_status() returns the completion status of the centering routine. It is 0, if the centering algorithm failed or if the user interrupted the routine.

In the non-automatic mode the user is asked for confirmation before the scan range is doubled.

Figure 7.1 displays the graphical output that is produced during scan/cent.

Figure 7.1: Monitoring scan/center
Image scan_cent