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:
option | description |
cell__a | unit cell parameters, same units as wavelength, the lattice centering using the first letter of the space group symbol |
cell__b | unit cell parameters, same units as wavelength |
cell__c | unit cell parameters, same units as wavelength |
cell_alpha | unit cell parameters, degree |
cell_beta | unit cell parameters, degree |
cell_gamma | unit cell parameters, degree |
cell_lattice_[P,A,B,C,I,F,R] | lattice centering type. Try P if you are not sure |
distance | sample detector distance, same units as pixel size. |
fit_tolerance | tolerance 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 |
o11 | detector flip element +1 for frelon & quantix |
o12 | detector flip element 0 for frelon & quantix |
o21 | detector flip element 0 for frelon & quantix |
o22 | detector flip element -1 for frelon & +1 for quantix |
omegasign | Sign of the rotation about z (normally +1 for right handed) |
t_x | crystal translation, units as distance/pixels |
t_y | crystal translation, units as distance/pixels |
t_z | crystal translation, units as distance/pixels |
tilt_z | detector tilt, right handed around z (The tilts are in radians about the y/z axes in the ID11 co-ordinate system ) |
tilt_x | detector tilt, right handed around x |
tilt_y | detector tilt, right handed around y |
wavelength | wavelength, normally angstrom same as units unit cell |
y-center | Beam 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-size | pixel size in horizontal, same units as distance |
z-center | Beam centre in vertical, pixels |
z-size | pixel 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_prob | Number of bins to use in histogram based filters |
Functionalities
- Compute tth eta
- Add unit cell peaks
- tth Histogram
- Fit
- compute g-vector
- save g-vector
- save filtered peaks
More information concerning parameters
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.
- The "z_center" is measured in the "slow" pixel direction,
- the
"y_center" is in the fast pixel direction.
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"
.
- Scattering angles "two theta" and
"azimuth" or perhaps "eta" are in degrees.
Some physicists use a factor
of 2 pi here, which tends to occlude the B matrix, below.
-
The UB and UBI matrices are defined as the transformation matrices
between scattering vectors and unit h, k, l indices of diffraction spots.
Thus, UB has the units of scattering vector and UBI has the units of
wavelength and unit cell. We think, but are not 100% sure, that these
matrices correspond to the 3 primitive vectors of the crystal lattice in
reciprocal (UB) and real space (UBI).
- Detector tilt angles are measured in radians.
- Diffractometer angles are
measured in degrees.
- Unit cell angles are measured in degrees.
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.
|
Transformer is a part if ImageD11,a software package for analysis of 2D diffraction images. The package includes:
|
- peaksearch,
- transformer used to calibrate and to compute g-vectors,
- fitgrain to refine of diffractometer geometry,
- filtergrain to indexing grains
- fft_index.py to index large unit cells,
- Some useful tools like edf2bruker.py and bgmaker.py,
- and fit2cake to carry out radial integration of series of images.
|