Beam Center Calibration

Mount a loop with some glycerol and Cr2O3 powder, which can be found on each beamline.
In mxCuBE, on the Hutch tab, click Calibrate.

mxCube has, on the Hutch tab, a Calibrate button that aid beam center calibration while using powders. mxCuBE will now collect 10 images, (usually called 'Cr2O3_1_###.img' 'in the '/data/id14eh4/archieve/powder/datestamp' directory) at different distances between 100 and 525mm. The patterns contain powder rings, that can be used to refine wavelength, direct beam position, and xtal-detector distance as described below. A 'powder.inp' script is also written and run (powder.log) in this directory.

All the output is important. For those people that want to read the minimum, please make sure:
*) you use the correct detector format
*) you start with sensible starting numbers - eg from previous calibration
*) check in the last table "Number of peaks and number of indexed peaks found on each frame: - is the number of peaks per frame making sense? It should go down with increasing detector-xtal distance - is their a fair number of indexed peaks? Should be eg >90% overall
*) Is <|d_obs - d_calc|> small? Should become < 0.01Ang
*) If there is any doubt, please check result using ipdisp -a -f name.img

The ax, bx, ay, and by values should then be modified in the 'mxlocal.mac' to ensure they are correctly written to the automatically generated process files or image headers. These values should also be recorded in the log book.

The position where the direct beam would hit the detector if there was no beamstop in place, can be recalibrated using the program powder which can be. It is based on the indexing and refinement of a series of diffraction images of a powder with known d-spacings, taken at different distances between the sample and the detector. Typically, we use Cr2O3-powder with some grease in a loop an collect at 10 different distances in order to obtain refined values for <|d_obs - d_calc|> of less than 0.01 Å. The position of the beam center as well as the "true" crystal-detector distance are given as linear functions:


x_beam    = a_x * dist_spec + b_x
y_beam    = a_y * dist_spec + b_y
distance  = a_d * dist_spec + b_d


The current calibration constants are given in the eh4-spec session. The values

a_x b_x a_y

and

b_y

are given as AXBeam BXBeam AYBeam and BYBeam in the eh4-setup file, whereas the values a_d and b_d are used in the config file. ProDC will write the correct beamcenter into the ascii header of the images. Please write down your new suggestions for these numbers in the logbook and get in contact with Raimond (7289) before changing them in spec!

Below you find a table with older calibration coefficents as well:

 Date Function a b (mm) < | d_obs - d_calc| > (Å) 9 December 2005 x_beam -0.0013 157.31 y_beam 0.0033 156.83 distance 1.0002 0.11

Powder

The program

powder

(to be run under linux) can read in up to 50 powder images, index them and minimizes < |d_obs - d_calc| > while refining linear functions for the beam center and "true" distance, as well as detector twist and tilt and the wavelength. The input file looks like:


FORMAT Q4UNBIN
>FORMAT Q210bin
>FORMAT MCCD165
>FORMAT MAR225
POWDER cr2o3_100_001.img 100.0
POWDER cr2o3_125_001.img 125.0
POWDER cr2o3_150_001.img 150.0
POWDER cr2o3_175_001.img 175.0
POWDER cr2o3_200_001.img 200.0
POWDER cr2o3_225_001.img 225.0
POWDER cr2o3_250_001.img 250.0
POWDER cr2o3_275_001.img 275.0
POWDER cr2o3_300_001.img 300.0
DVALUES 3.645 2.672 2.487 2.181 1.819 1.676 1.467 1.433
>DVALUES 3.125 2.706 1.914 1.632 1.5624 1.353 1.242
START  0.9747  0.0   0.0  1.0040 -0.4  94.89  0.002 94.84   0.003
DSTART  0.0001  1.0   1.0  0.0002  0.2   0.2   0.1    0.2    0.1
>DSTART  0.00001 1.0   1.0  0.0002  0.02  0.1   0.01   0.1    0.01
TOLERANCE 0.0001
>RASTER 0.081


• The FORMAT command selects the detector type: Q4unbinned, Q210binned, MCCD165mm MAR225unbinned.
• The POWDER command has two arguments: filename of the image and the sample-to-dector distance as given by spec.
• The DVALUES command should give the d-spacing of the powder used. The program has default values for alpha-Al2O3. The values given here are those of Cr2O3.
• The START command gives the initial values for lambda tilt twist a_d b_d b_x a_x b_y a_y , where a and b are the coefficient of the linear functions to describe the "true" distance (dist = a_d * dist_spec + b_d) and beam position (x_beam = a_x * dist_spec + b_x and y_beam = a_y * dist_spec + b_y). lambda is given in Å and the tilt and twist in mrad.
• The DSTART command gives the expected errors in parameters of the START command. It is very important that one gives reasonable values here, they will affect the final convergence. Read the notes given below!
• The TOLERANCE command gives the difference between successive refinement cycles for which the refinement is considered to be converged.
• The RASTER command can be used to overrule the programs default value for the raster size.
• All commands that are preceeded by > will be ignored.

The program is run like

powder < input.file

It will read the images and overlay a 10x10 grid on each image, afterwhich it determines the peaks on each line of the grid. The total number of peaks found per frame is printed, and should ideally go down as function of the sample-to-detector distance. Here comes part of the output file:

 POWDER start at Oct 28 11:53:08 2000
POWDER version Aug 31 1998 for unbinned 2x2 ADSC.

POWDER  cr2o3_100_001.img    100.0
POWDER  cr2o3_125_001.img    125.0
POWDER  cr2o3_150_001.img    150.0
POWDER  cr2o3_175_001.img    175.0
POWDER  cr2o3_200_001.img    200.0
POWDER  cr2o3_225_001.img    225.0
POWDER  cr2o3_250_001.img    250.0
POWDER  cr2o3_275_001.img    275.0
POWDER  cr2o3_300_001.img    300.0
DVALUES 3.645 2.672 2.487 2.181 1.819 1.676 1.467 1.433
START   0.9747  0.0   0.0  1.0036  0.0  94.94  0.002 94.86   0.003
DSTART  0.0001  1.0   1.0  0.0002  0.2   0.2   0.1    0.2    0.1
TOLERANCE 0.0001

Opening powder-diffraction file for reading: cr2o3_100_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23029
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0 42616
Number of peaks found on this frame:      294

Opening powder-diffraction file for reading: cr2o3_125_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23026
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0 42775
Number of peaks found on this frame:      277

Opening powder-diffraction file for reading: cr2o3_150_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23085
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0 31217
Number of peaks found on this frame:      224

Opening powder-diffraction file for reading: cr2o3_175_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23175
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0 11429
Number of peaks found on this frame:      190

Opening powder-diffraction file for reading: cr2o3_200_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23265
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0 11212
Number of peaks found on this frame:      171

Opening powder-diffraction file for reading: cr2o3_225_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23243
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0  8768
Number of peaks found on this frame:      153

Opening powder-diffraction file for reading: cr2o3_250_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23257
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0 13727
Number of peaks found on this frame:      116

Opening powder-diffraction file for reading: cr2o3_275_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23307
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0  9185
Number of peaks found on this frame:       77

Opening powder-diffraction file for reading: cr2o3_300_001.img
Nrow:  2304 Ncolumn:  2304 Nheader: 256
Number of pixels equal to zero:        23332
Number of pixels larger than 2**17 -1:     0
Minimum and maximum pixel value:           0  8291
Number of peaks found on this frame:       60

Total number of peaks found:             1562


The program will now try to index the peaks while stepping through different values of lambda, distance and beam center. It will give a list of lambda tilt twist a_d b_d b_x a_x b_y a_y #spots_indexed The step values are determined by the DSTART command. Only steps that increase the number of indexed spots are accepted. Make sure that a decent fraction of the total number of peaks are indexed at the end of this procedure. Change the parameters both in START and DSTART (e.g. increase the dstart value for b_d, b_x and b_y to 0.4) if this was not the case, and start again.

    0.9747    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   94.8600    0.0030        0
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   94.8600    0.0030      1553
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   94.8600    0.0030      1553
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559
0.9742    0.0000    0.0000    1.0036    0.0000   94.9400    0.0020   95.8600    0.0030      1559


Now the refinement of the parameters is started. The program uses a simplex method. A maximum of 20 cycles is used. Check in the following column whether the number of indexed spots per image is making sense. E.g., it could happen that you there are 0 spots indexed for one of the frames, in which case the starting distance was probably wrong for that frame. It could also happen that only a subset of the frames have a decent number of indexed spots: maybe your starting positions are too far of the real values and you should first refine them against a subset of frames. Play with these things!

Cycle number:   20
Number of peaks and number of indexed peaks found on each frame:
frame#  #peaks  #indexed  %indexed
1     294       250     85.03
2     277       257     92.78
3     224       211     94.20
4     190       185     97.37
5     171       171    100.00
6     153       153    100.00
7     116       115     99.14
8      77        74     96.10
9      60        59     98.33
Total     1562      1475     94.43


So this looks very nice! Next table is characteristic for the simplex method. Just looking at the last line is probably all you want to do. It gives the values for lambda tilt twist a_d b_d b_x a_x b_y a_y <|d_obs - d_calc|>.

Starting values for the rms-differences:
0.008283  0.008293  0.008321  0.008285  0.008299  0.008433  0.008615  0.162025  0.009932  0.162218
Simplex ended after   199 iterations.
Final values for x(1 .. 9), rms:
0.974237      4.17      0.10  1.004571 -0.469521 94.870148  0.001970 94.729340  0.004193       0.002365
0.974241      4.14      0.11  1.004567 -0.475509 94.877869  0.001939 94.729332  0.004191       0.002365
0.974239      4.13      0.10  1.004580 -0.475316 94.876923  0.001939 94.720940  0.004227       0.002365
0.974242      4.13      0.11  1.004563 -0.474855 94.876251  0.001944 94.732742  0.004170       0.002365
0.974240      4.10      0.11  1.004570 -0.473715 94.879227  0.001924 94.731537  0.004176       0.002365
0.974240      4.15      0.10  1.004567 -0.473839 94.876160  0.001943 94.730499  0.004173       0.002365
0.974238      4.08      0.10  1.004583 -0.472664 94.880753  0.001906 94.721970  0.004234       0.002365
0.974238      4.25      0.11  1.004573 -0.475027 94.865791  0.001988 94.719604  0.004242       0.002365
0.974239      4.15      0.11  1.004574 -0.470605 94.872543  0.001966 94.721710  0.004224       0.002365
0.974239      4.17      0.11  1.004574 -0.474794 94.873978  0.001962 94.722740  0.004234       0.002365


We now skip to the last refinement cycle. The program will stop earlier than at refinement cycle 1 if convergence was obtained. This is determined by the command CONVERGENCE, for which 0.0001 is a good value. You will probably overrefine everything if you use a value that is too small.

Cycle number:   18
Number of peaks and number of indexed peaks found on each frame:
frame#  #peaks  #indexed  %indexed
1     294       284     96.60
2     277       275     99.28
3     224       221     98.66
4     190       189     99.47
5     171       170     99.42
6     153       153    100.00
7     116       109     93.97
8      77        67     87.01
9      60        52     86.67
Total     1562      1520     97.31
Starting values for the rms-differences:
0.001008  0.001008  0.001008  0.001008  0.001008  0.001009  0.001008  0.001008  0.001008  0.001009
Simplex ended after     8 iterations.
Final values for x(1 .. 9), rms:
0.974240      3.49      0.08  1.004499 -0.415971 94.892838  0.001890 94.837921  0.003413       0.001008
0.974240      3.51      0.08  1.004500 -0.417390 94.892593  0.001883 94.837044  0.003421       0.001008
0.974240      3.49      0.08  1.004497 -0.415806 94.893982  0.001881 94.840851  0.003396       0.001008
0.974240      3.48      0.08  1.004501 -0.418488 94.896042  0.001862 94.838440  0.003411       0.001008
0.974240      3.50      0.08  1.004496 -0.416369 94.892944  0.001885 94.840912  0.003395       0.001008
0.974239      3.52      0.08  1.004498 -0.415906 94.890945  0.001892 94.839203  0.003401       0.001008
0.974240      3.51      0.08  1.004497 -0.415631 94.891037  0.001895 94.838776  0.003408       0.001008
0.974240      3.51      0.08  1.004497 -0.417930 94.893021  0.001882 94.839241  0.003410       0.001008
0.974240      3.49      0.08  1.004498 -0.417501 94.894577  0.001876 94.838760  0.003412       0.001008
0.974240      3.49      0.08  1.004499 -0.417360 94.894745  0.001871 94.839722  0.003402       0.001008
Refinement converged.

Final parameters.
Refined value for lambda: 0.9742 (0.0001)
Refined value for tilt:     3.5 (0.0)
Refined value for twist:    0.1 (0.0)
Table of spec-distance, refined distance and refined beam position, in mm and pixels.
100.00     100.03 (0.001)     95.08 (0.000)  95.18 (0.001)      1165.2 (0.00)   1166.4 (0.01)
125.00     125.15 (-.001)     95.13 (0.001)  95.26 (0.002)      1165.8 (0.01)   1167.5 (0.02)
150.00     150.26 (0.004)     95.18 (0.000)  95.35 (0.002)      1166.4 (0.00)   1168.5 (0.02)
175.00     175.37 (-.002)     95.22 (0.000)  95.44 (0.001)      1166.9 (0.00)   1169.5 (0.01)
200.00     200.48 (0.004)     95.27 (-.001)  95.52 (0.000)      1167.5 (-.01)   1170.6 (0.00)
225.00     225.60 (0.000)     95.32 (0.001)  95.61 (-.001)      1168.1 (0.01)   1171.6 (-.01)
250.00     250.71 (0.016)     95.36 (0.002)  95.69 (-.001)      1168.7 (0.02)   1172.7 (-.01)
275.00     275.82 (-.008)     95.41 (0.000)  95.78 (0.002)      1169.2 (0.00)   1173.7 (0.02)
300.00     300.93 (0.008)     95.46 (-.002)  95.86 (0.001)      1169.8 (-.02)   1174.8 (0.01)
POWDER ended at Oct 28 11:53:48 2000    00:00:39 CPU_time used


Normally, a simplex refinement does not converge optimally in one go. You therefore might rerun the program with the improved values for START and DSTART. Use values from the last refinement cycle, e.g. START 0.9742 3.5 0.1 1.0045 -0.42 94.89 0.0019 94.84 0.0034 and take small values for the differences DSTART. Check if the final refined values are making sense, both in terms of expectations about the different parameters, and by checking the indexing of a few frames using the programs ipdisp. For the adsc-detector:

		ipdisp -a -f cr2o3_200_001.img


Give the refined values for the wavelength, distance and beam position in the ipdisp program, as well as one of the known d-spacings of the powder used. Click on circles: the predicted circle should precisly overlap with the observed ring.

NOTE that the wavelength and the crystal-to-detector distance are to some extend correlated, and that different combinations of lambda, a_d and b_d could be obtained if one tries to overrefine them, e.g. when using very small values for the TOLERANCE. A way to overcome this, apart from taking a large number of powder-diffraction patterns at different distances, is to restrain either the wavelength or the distance tightly by given a very small number for the relevant DSTART value. E.g., lambda will hardly change when dlambda is set to 0.00001 while da_d and db_d are much larger.

The program powder was written by Raimond Ravelli.