Transformer is a program written in python by Jon Wright(esrf.eu) to calibrate sample-detector distance , detector tilts and beam center with filtered peaks and generate gve vector files.

Calibration

To calibrate data, transformer load a parameter file. Here is a list of values and their description in a parameter file:
optiondescription
cell__a unit cell parameters, same units as wavelength, the lattice centering using the first letter of the space group symbol
cell__bunit cell parameters, same units as wavelength
cell__cunit cell parameters, same units as wavelength
cell_alphaunit cell parameters, degree
cell_betaunit cell parameters, degree
cell_gammaunit cell parameters, degree
cell_lattice_[P,A,B,C,I,F,R]lattice centering type. Try P if you are not sure
distancesample detector distance, same units as pixel size.
fit_tolerancetolerance to decide which peaks to use. The fit tolerance is the difference in degrees between observed and computed peak positions to use in parameter refinement
o11detector flip element +1 for frelon & quantix
o12detector flip element 0 for frelon & quantix
o21detector flip element 0 for frelon & quantix
o22detector flip element -1 for frelon & +1 for quantix
omegasignSign of the rotation about z (normally +1 for right handed)
t_xcrystal translation, units as distance/pixels
t_ycrystal translation, units as distance/pixels
t_zcrystal translation, units as distance/pixels
tilt_zdetector tilt, right handed around z (The tilts are in radians about the y/z axes in the ID11 co-ordinate system )
tilt_xdetector tilt, right handed around x
tilt_ydetector tilt, right handed around y
wavelengthwavelength, normally angstrom same as units unit cell
y-centerBeam centre in horizontal, pixels.The position of the beam centre and pixel sizes are used to transform the spatially corrected peak positions into real space peaks positions. 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.
y-sizepixel size in horizontal, same units as distance
z-centerBeam centre in vertical, pixels
z-sizepixel size in vertical, same units as distance
wedge wedge, rotation around y under omega
chi wedge, rotation around x under omega
no_bins Number of bins to use in histogram based filters
min_bin_probNumber of bins to use in histogram based filters

Functionalities

  1. Compute tth eta
  2. Add unit cell peaks
  3. tth Histogram
  4. Fit
  5. compute g-vector
  6. save g-vector
  7. save filtered peaks

More information concerning parameters

Distance parameter

The "distance" parameter in ImageD11 is defined as the length of a vector from the diffractometer rotation axis to the plane of the 2D detector in a direction parallel to the x-ray beam ("x").
The tilts of the detector plane are applied as rotations about the point of interception of this vector and plane.
This definition will break down if the detector plane is parallel to the beam.

Remark : Some other programs have defined the distance as being along a vector parallel to the detector normal, which avoids the problem of the definition breaking down. However, in the event that someone has a detector on a two theta arm, it makes more sense to leave the distance and tilts defined at the zero of the arm movement, and then add such a rotation as a new feature in the program.
This would allow a distinction between the actual tilt in the mounting of the detector and the diffractometer motor movement, so that a "tilt" parameter will not be continually changing during the normal operation of an instrument.

What about units?

"Pixels" are used for beam center and peak positions. These correspond to the addresses of storage units in the memory of an a computer, as that is where the program observes the image. They are indices in "slow" and "fast" directions corresponding to a two dimensional array being laid out in a single block of memory that is accessed by a single offset value.
Perhaps these will be renamed to s_center and f_center in the future if someone finds time to write a backwards-compatible patch. Detector pixel size (t_x), distance (t_y), and grain translations (t_z) are all measures of length.
The program supports any unit you choose, including millimetres, microns and inches. However, you must use the *same* unit for all three. You might run into problems with the print formatting or overflow if you choose a unit like light years.
If you "flip" an image either by giving a negative pixel size, or by using a 2x2 transformation matrix, or by applying tilt angles of integer multiples of pi about tilt_y or tilt_z or pi/2 around tilt_x, or any combination of these, the transformation matrix (o11,o12,o21,o22) is applied about the beam center after the peak positions have been corrected for the spatial distortion and pixel size of the detector.
Normally, an instrument should be calibrated using data measured from a single crystal in order to determine the diffractometer axis tilts, as well as to confirm the sense of the axis and image.
The script plot3d.py was previously able to plot scattering vectors and a diffraction image texture mapped onto the Ewald sphere in a 3D display together with a laboratory x, y and z axes. It would clearly be worthwhile to revive this code for checking the orientations of images, as well as educational purposes of teaching diffraction theory.
The unit cell parameter lengths and wavelength are also measures of length and you are free to choose either Angstroms, picometers etc. You may use different units for these lengths, which are derived from "reciprocal space", compared to the lengths above, which are in "real space".
ImageD11 computes scattering vectors which are in "reciprocal space". These have inverse lengths, and have units reciprocal to the wavelength and unit cell. No factor of 2pi is introduced, so that a diffracted beam generated by Braggs law:
"lambda = 2d sin(theta)"

will give a scattering vector having a length of:
"1/d"
.
The omegasign parameter is expected to be + or - one and is the handedness of the diffractometer rotation. "+1" corresponds to a right handed movement around z for Omega increasing.

ImageD11

Transformer is a part if ImageD11,a software package for analysis of 2D diffraction images. The package includes:
  1. peaksearch,
  2. transformer used to calibrate and to compute g-vectors,
  3. fitgrain to refine of diffractometer geometry,
  4. filtergrain to indexing grains
  5. fft_index.py to index large unit cells,
  6. Some useful tools like edf2bruker.py and bgmaker.py,
  7. and fit2cake to carry out radial integration of series of images.