Spice_icon SPICE
Spectrometer Instrument Control Environment


calibrate:

The "calibrate" command is used to perform a standard powder calibration.

The syntax for the "calibrate" command is :

     calibrate begin [beg_opts]

is used to initialize the calibration.  The options for calibrate begin (i.e. beg_opts) are any of:

     1. file = filename (the name of the calibration file - a file name will be automatically generated if none is given)
     2. standard = name (which must be included in the top-level configuration file)
     3. energy = value (if no energy is specified, the current value of Ei is assumed).

OR

     calibrate fit [fit_opts]

will fit either the LAST scan or a specified scan number using options specified in fit_opts.  The avaliable options for calibrate fit are any of:

     1. scan = n (will use the data in scan n - NOTE that the last scan will be used if no scan number is specified)
     2. indices = h k l
     3. npeaks = n (the number of Gaussians to fit to)
     4. guess = back  height1 fwhm1 pos1 height2 fwhm2 pos2 (where back=background, height1=the amplitude of peak 1, fwhm1=the full-width at half-maximum for peak 1, pos1=the position of peak 1, etc.)
     5. peakstore = n (the peak position to store in the calibration file - this option is only needed if npeaks is greater than 1)

It is important to note that only one peak can be added at a time using the calibrate command so if multiple peaks are included in the scan which should both be added to the calibration file, the calibrate fit command must be issued multiple times (2 times for 2 peaks for example). In addition, note that a valid calibrate begin must be issued prior to any calibrate fit commands as the begin option generates and initializes the calibration file.

OR

     calibrate finish [finish_opts]

will complete the calibration.  The available option for calibrate finish is:
 
     1. file=filename (if not given, the stored filename from the calibrate begin command is used)



An example of a macro which uses the calibrate command is shown below.  Note this macro will do a complete Ni-powder calibration for energies between 5 and 20 meV.

calibrate begin standard ni energy %1
drive ei %1
preset time %2
drive s2 -2*57.3*asin((sqrt((81.8*3)/(%1*4)))/(7.048))
scantitle "Ni powder (0.5,0.5,0.5)"
scan s2 @(s2)+1.5 @(s2)-1.5 .1
calibrate fit indices 0.5 0.5 0.5
drive s2 -2*57.3*asin((sqrt((81.8)/(%1)))/(7.048))
scantitle "Ni powder (1,0,0)"
scan s2 @(s2)+1.5, @(s2)-1.5,.1
calibrate fit indices 1 0 0
drive s2 -2*57.3*asin((sqrt((81.8*2)/(%1)))/(7.048))
scantitle "Ni powder (1,1,0)"
scan s2 @(s2)+1.5, @(s2)-1.5,.1
calibrate fit indices 1 1 0
drive s2 -2*57.3*asin((sqrt((81.8*3)/(%1)))/(7.048))
scantitle "Ni powder (0.5,0.5,1.5) and (1,1,1)"
scan s2 @(s2)+5.5, @(s2)-2,.1
calibrate fit indices 0.5 0.5 1.5 npeaks 2 peakstore 1
calibrate fit indices 1 1 1 npeaks 2 peakstore 2
drive s2 -2*57.3*asin((sqrt((81.8*4)/(%1)))/(7.048))
scantitle "Ni powder (2,0,0)"
scan s2 @(s2)+2, @(s2)-2,.1
calibrate fit indices 2 0 0
calibrate finish

The above macro takes a single argument which is the energy in meV (%1 in the macro above).  The drive commands use energy and the known d-spacing of Ni to drive to the calculated position for each of the Bragg reflections.  The calibrate begin,calibrate fit, and calibrate finish commands perform the calibration.


The calibrate command cal also be accessed directly from the GUI by selecting the Nickel Calibration tab from the Setup top-level tab.  To begin a calibration, the user types in the energy at which the Ni calibration will be performed, selects an appropriate count time, and clicks the blue Perform Calibration button.  While the calculation is taking place, a green Calibration Running button is visible as shown in the image below.

calibration running

During the calibration, the user can examine the scans and the generated fit by selecting the Reflection pull-down menu.  If any of the fits are not satisfactory, the Redo Fit button will bring up a popup box where initial guess parameters can be input.  Following the completion of the calibration, the Calibration Running button will be replaced by the boxes shown below where the current and calculated zero angles for motors m2 and s2 are shown.  The user can examine the output in the logfile from the calibrate finish command or can click on the blue Print Results button which will produce a hardcopy of the output from the calibrate finish command.  If the calibration seems satisfactory, the uses accepts the new zero angles by clicking on the blue Accept new zero angles button.

calibration finished

After accepting the new zero angles, the Accept new zero angles button will disappear and the current and calculated zero angles should now be identical as shown in the bottom image.  This will complete the Ni powder calibration.

calibration accepted