Demos for using the resolution convolution are available in the source distribution which can be downloaded here. To use these demos, please unpack the archive from the link. The full documentation for Takin and further tutorials can be found here.
The demo convolution uses the Python backend for creating S(q,E) models. In the example, the model file can be found in the file “sqw_phonon.py”. In there, the most important (and only mandatory) interface function for Takin is “TakinSqw(h, k, l, E)”, which receives the (hkl) coordinates (in rlu) and the energy transfer E (in meV) of each random Monte-Carlo neutron events from Takin, and has to return the dynamical structure factor S(h, k, l, E) for the queried coordinate. How the structure factor is calculated is up to the user. In the example, a simple sinusoidal phonon dispersion branch with a DHO shape in energy is created.
Each parameter in the Python S(q,E) model script (here: “sqw_phonon.py”) which is global and whose name begins with “g_” is a parameter that can be changed directly from Takin and that can also be defined as a fit parameter. In the convolution dialog, they can be inspected and modified by clicking on the “Parameters…” button.
To fit a parameter, follow these steps: