Diffcalc is used for controlling diffractometers within reciprical lattice space.
A system of geometry plug-ins tailors the core code for specific diffractometers. A four-circle plug-in for example will hide the five and six-circle modes from the user and fix two of the angles internal to the core code. So far there is a four-circle plug-in (used by Rasor), a five-circle plug-in (used on b16) and four different six-circle geometries (two for i07 and one destined for i16).
Diffcalc does not directly move motors or perform scans: it ties into the gda through the gda’s system of scannables and depends on the gda’s scan command to perform scans. Parameters, fixed angles, energy, or hkl may be scanned over. Diffcalc adds its commands to the gda’s standard list.
Example
In this example, after creating a new orientation calculation to hold the crystal parameters and reflection list, a crystal lattice is specified, and two reflections are added to the list causing a UB matrix to be calculated. A four-circle bisecting mode is selected, which for this five-circle diffractometer requires one parameter alpha to be fixed. Alpha is then scanned and at each step the 001 reflection is visited and the counter timer ct is counted for 1 second. When the hkl scannable is moved it asks diffcalc where to move fivec and then moves it. This hkl scannable also returns the two-theta angle, incoming angle and azimuthal angle. More complex scans can be easily built up.
