# Welcome to ImageD11

#### Calibration

Calibration of the sample-detector distance, detector tilts and beam centre are one of the fundamental reasons for creating the ImageD11 program and having the sometimes annoying graphical interface.
The menu offers the option to read in previously determined parameters from a file:

cell__a | 5.8 | unit cell parameters (in angstroms/degrees)
cell__b | 5.8
cell__c | 5.8
cell_alpha | 90.0
cell_beta | 90.0
cell_gamma | 90
cell_lattice_[P,A,B,C,I,F,R] | F | The lattice centering using the first letter of the space group symbol
distance | 294662.658 | The sample detector distance is normally in millimeters.
fit_tolerance | 0.2 | The fit tolerance is the difference in degrees between observed and computed peak positions to use in parameter refinement.
o11 | 1
o12 | 0
o21 | 0
o22 | -1
omegasign | 1.0
t_x | 129.322427382
t_y | 11.8135159025
t_z | 0
tilt_x | 0.00000 | The tilts are in radians about the y/z axes in the ID11 co-ordinate system (z is vertical, y is horizontal).
tilt_y | -0.013173
tilt_z | 0.002378
wavelength | 0.154
y-center | 1016.328171 | The position of the beam centre and pixel sizes are used to transform the spatially corrected peak positions into real space peaks positions.
y-size | 48.0815
z-center | 984.924425
z-size | 46.77648

You MUST use the values for pixel size recorded in the spline file if you have made a spatial distortion for things to work out properly.

Having read in some data which was output from the peaksearching menu you can make a plot of two theta / eta and then add unit cell peaks. The horizontal axis represents the peak positions in two theta with the eta value being the angle around a powder ring measured from the vertical.

If the initial parameters for the transformation are good then you will hopefully find nearly vertical lines made up of the diffraction spots from all of your grains with crosses overlaying them indicating the computed peak positions.
If the parameters are not so good then the lines will be deformed and perhaps not match the computed positions.

To improve the fit you can change the parameters manually in fit group.
You can also choose to fit the parameters where peaks which are within fit_tolerance of the computed positions are used for a simplex minimisation procedure. Usually this works better if you zoom in on the low angle data first and then repeat the fit after replotting and unzooming to use the full range of data. It works better that way because you are less likely to mis-assign low angle peaks as there is less peak overlap.

Once the parameters are refined and the transformation gives vertical lines you can hope to make a good computation of g-vectors.