1.3.11. - Diffractometer Geometry
You can operate a two-circle diffractometer in terms of angles alone. However, for a four-circle diffractometer (and others such as the z-axis or liquid-surface diffractometers) it makes more sense to work in three-dimensional reciprocal space coordinates. It is therefore necessary to be able to calculate angles according to the diffractometer geometry.
spec is designed to accommodate a variety of diffractometer configurations. The particular calculations are contained in geometry code (the source for which is included in the standard spec package.) accessible through the
calc()
function.
The arguments to
calc()
determine the particular code that is called.
For example, a
calcA
macro is defined as
calc(1)
. Its purpose is to load the
A[]
array with the angles corresponding to the current reciprocal space
coordinates.
The four-circle configuration represents the
three reciprocal space coordinates
as the first elements of the built-in array
Q[]
. For convenience, the following definitions are made:
def H 'Q[0]' def K 'Q[1]' def L 'Q[2]'Thus, to move to a position in reciprocal space such as the point [100], the appropriate commands would be
1.FOURC> H = 1; K = L = 0; waitmove; getangles; calcA; move_all
2.FOURC>
Whenever the
move_all
command is used, it is important that the
A[]
array contain the current motor positions for all motors except the ones
to be moved.
In the above example, the
getangles
command loads
A[]
with the current positions after the
waitmove
ensures all motors have stopped.
The
calcA
changes the appropriate elements of the
A[]
array and the
move_all
starts the motors.
Often, you might change a single angle, or several angles, and then wonder where in reciprocal space the diffractometer is set. The
calcHKL
macro will take the positions in the
A[]
array and set the variables
H
, K
, and
L
to the calculated coordinates.
For example:
1.FOURC> waitmove; getangles; calcHKL; print H, K, L
1 0 0 2.FOURC>
The command
getangles
loads the
A[]
array with the current positions.