1. Introduction

Diffcalc is a diffraction condition calculator used for controlling diffractometers within reciprocal lattice space. It performs the same task as the fourc, sixc, twoc, kappa, psic and surf macros from SPEC.

Diffcalc’s standard calculation engine is an implementation of [You1999] . The first versions of Diffcalc were based on [Vlieg1993] and [Vlieg1998] and a ‘Vlieg’ engine is still available. The ‘You’ engine is more generic and the plan is to remove the old ‘Vlieg’ engine once beamlines have been migrated. New users should use the ‘You’ engine.

The foundations for this type of calculation were laid by by Busing & Levi in their classic paper [Busing1967]. Diffcalc’s orientation algorithm is taken from this paper. Busing & Levi also provided the original definition of the coordinate frames and of the U and B matrices used to describe a crystal’s orientation and to convert between Cartesian and reciprical lattice space.

Geometry plugins are used to adapt the six circle model used internally by Diffcalc to apply to other diffractometers. These contain a dictionary of the ‘missing’ angles which Diffcalc uses to constrain these angles internally, and a methods to map from external angles to Diffcalc angles and visa versa.

Options to use Diffcalc:

  • The User manual next to this developer manual or README file on github.
  • The quickstart-api section describes how to run up only the core in Python. This provides a base option for system integration.

Diffcalc will work with Python 2.7 or higher with numpy, or with Jython 2.7 of higher with Jama.

[*]The very small ‘Willmott’ engine currently handles the case for surface diffraction where the surface normal is held vertical [Willmott2011]. The ‘You’ engine handles this case fine, but currently spins nu into an unhelpful quadrant. We hope to remove the need for this engine soon.
[You1999]H. You. Angle calculations for a ‘4S+2D’ six-circle diffractometer. J. Appl. Cryst. (1999). 32, 614-623. (pdf link).
[Busing1967]W. R. Busing and H. A. Levy. Angle calculations for 3- and 4-circle X-ray and neutron diffractometers. Acta Cryst. (1967). 22, 457-464. (pdf link).
[Vlieg1993]Martin Lohmeier and Elias Vlieg. Angle calculations for a six-circle surface x-ray diffractometer. J. Appl. Cryst. (1993). 26, 706-716. (pdf link).
[Vlieg1998]Elias Vlieg. A (2+3)-type surface diffractometer: mergence of the z-axis and (2+2)-type geometries. J. Appl. Cryst. (1998). 31, 198-203. (pdf link).
[Willmott2011]C. M. Schlepütz, S. O. Mariager, S. A. Pauli, R. Feidenhans’l and P. R. Willmott. Angle calculations for a (2+3)-type diffractometer: focus on area detectors. J. Appl. Cryst. (2011). 44, 73-83. (pdf link).