1 * Welcome to hkl's @VERSION@ documentation!
4 The purpose of the library is to factorise single crystal diffraction
5 angles computation for different kind of diffractometer geometries. It
6 is used at the SOLEIL, Desy and Alba synchrotron with the Tango control
7 system to pilot diffractometers.
11 - mode computation (aka PseudoAxis)
13 - item for different diffractometer geometries.
15 - UB matrix computation.
17 - busing & Levy with 2 reflections
18 - simplex computation with more than 2 reflections using the GSL
20 - Eulerians angles to pre-orientate your sample.
22 - Crystal lattice affinement
24 - with more than 2 reflections you can select which parameter must
29 - psi, eulerians, q, ...
33 In all this document the next convention will be used to describe the
34 diffractometers geometries.
36 - right handed convention for all the angles.
37 - direct space orthogonal base.
38 - description of the diffractometer geometries is done with all axes
44 A periodic crystal is the association of a pattern and a lattice. The
45 pattern is located at each points of the lattice node. Positions of
46 those nodes are given by:
48 $$R_{uvw}=u\cdot\vec{a}+v\cdot\vec{b}+w\cdot\vec{c}$$
50 $\vec{a}$, $\vec{b}$, $\vec{c}$ are the former vector of a base of the
51 space. =u=, =v=, =w= are integrers. The pattern contain atomes
52 associated to each lattice node. the purpose of diffraction is to study
53 the interaction of this crystal (pattern+lattice) with X-rays.
55 #+CAPTION: Crystal direct lattice.
57 [[../../figures/crystal.png]]
58 this lattice is defined by $\vec{a}$, $\vec{b}$, $\vec{c}$ vectors, and
59 the angles $\alpha$, $\beta$, $\gamma$. In general cases this lattice is
62 Nevertheless to compute the interaction of this real space lattice and
63 the X-Rays, it is convenient to define another lattice called reciprocal
64 lattice defined like this:
67 \vec{a}^{\star} & = & \tau\frac{\vec{b}\wedge\vec{c}}{\vec{a}\cdot(\vec{b}\wedge\vec{c})}\\
68 \vec{b}^{\star} & = & \tau\frac{\vec{c}\wedge\vec{a}}{\vec{b}\cdot(\vec{c}\wedge\vec{a})}\\
69 \vec{c}^{\star} & = & \tau\frac{\vec{a}\wedge\vec{b}}{\vec{c}\cdot(\vec{a}\wedge\vec{b})}
72 $\tau=2\pi$ or $\tau=1$ depending on the conventions.
74 It is then possible to define thoses orthogonal properties:
77 \vec{a}^{\star}\cdot\vec{a}=\tau & \vec{b}^{\star}\cdot\vec{a}=0 & \vec{c}^{\star}\cdot\vec{a}=0\\
78 \vec{a}^{\star}\cdot\vec{b}=0 & \vec{b}^{\star}\cdot\vec{b}=\tau & \vec{c}^{\star}\cdot\vec{b}=0\\
79 \vec{a}^{\star}\cdot\vec{c}=0 & \vec{b}^{\star}\cdot\vec{c}=0 & \vec{c}^{\star}\cdot\vec{c}=\tau
82 This reciprocal space lattice allow to write in a simpler form the
83 interaction between the crystal and the X-Rays. We often only know about
84 $\vec{a}$, $\vec{b}$, $\vec{c}$ vectors and the angles $\alpha$,
85 $\beta$, $\gamma$. Using the previous equations reciprocal, we can
86 compute the reciprocal lattice this way:
89 a^{\star} & = & \frac{\sin\alpha}{aD}\\
90 b^{\star} & = & \frac{\sin\beta}{bD}\\
91 c^{\star} & = & \frac{\sin\gamma}{cD}
96 $$D=\sqrt{1-\cos^{2}\alpha-\cos^{2}\beta-\cos^{2}\gamma+2\cos\alpha\cos\beta\cos\gamma}$$
98 To compute the angles between the reciprocal space vectors, it is once
99 again possible to use the previous equations reciprocal to obtain the
100 sinus and cosinus of the angles $\alpha^\star$, $\beta^\star$ et
104 \cos\alpha^{\star}=\frac{\cos\beta\cos\gamma-\cos\alpha}{\sin\beta\sin\gamma} & \, & \sin\alpha^{\star}=\frac{D}{\sin\beta\sin\gamma} \\
105 \cos\beta^{\star}=\frac{\cos\gamma\cos\alpha-\cos\beta}{\sin\gamma\sin\alpha} & \, & \sin\beta^{\star}=\frac{D}{\sin\gamma\sin\alpha}\\
106 \cos\gamma^{\star}=\frac{\cos\alpha\cos\beta-\cos\gamma}{\sin\alpha\sin\beta} & \, & \sin\gamma^{\star}=\frac{D}{\sin\alpha\sin\beta}
111 Let the incomming X-rays beam whose wave vector is $\vec{k_{i}}$,
112 $|k_{i}|=\tau/\lambda$ where $\lambda$ is the wavelength of the signal.
113 The $\vec{k_{d}}$ vector wavelength of the diffracted beam. There is
114 diffusion if the diffusion vector $\vec{q}$ can be expressed as follows:
116 $$\vec{q}=\vec{k_{d}}-\vec{k_{i}}=h.\vec{a}^{*}+k.\vec{b}^{*}+l.\vec{c}^{*}$$
118 where $(h,k,l)\in\mathbb{N}^{3}$ and $(h,k,l)\neq(0,0,0)$. Thoses
119 indices $(h,k,l)$ are named Miller indices.
121 Another way of looking at things has been given by Bragg and that famous
124 $$n\lambda=2d\sin\theta$$
126 where $d$ is the inter-plan distance and $n \in
129 The diffusion accure for a unique $\theta$ angle. Then we got $\vec{q}$
130 perpendicular to the diffraction plan.
132 The Ewald construction allow to represent this diffraction in the
139 The quaternions will be used to discribe the diffractometers geometries.
140 Thoses quaternions can represent 3D rotations. There is different way to
141 describe then like complex numbers.
149 To compute the quaternion's norm, we can proceed like for complex
152 $$\lvert q \rvert = \sqrt{a{{}^2}+b{{}^2}+c{{}^2}+d{{}^2}}$$
156 $$q^{*}=[a,-\vec{u}]=a-bi-cj-dk$$
160 The difference with the complexnumber algebre is about
166 ~ & 1 & i & j & k \cr
167 1 & 1 & i & j & k \cr
168 i & i & -1 & k & -j \cr
169 j & j & -k & -1 & i \cr
173 The product of two quaternions can be express by the Grassman product
174 Grassman product. So for two quaternions $p$ and $q$:
177 q &= a+\vec{u} = a+bi+cj+dk\\
178 p &= t+\vec{v} = t+xi+yj+zk
183 $$pq=at-\vec{u}\cdot\vec{v}+a\vec{v}+t\vec{u}+\vec{v}\times\vec{u}$$
187 $$pq=(at-bx-cy-dz)+(bt+ax+cz-dy)i+(ct+ay+dx-bz)j+(dt+az+by-cx)k$$
191 L'ensemble des quaternions unitaires (leur norme est égale à 1) est le
192 groupe qui représente les rotations dans l'espace 3D. Si on a un vecteur
193 unitaire $\vec{u}$ et un angle de rotation $\theta$ alors le quaternion
194 $[\cos\frac{\theta}{2},\sin\frac{\theta}{2}\vec{u]}$ représente la
195 rotation de $\theta$ autour de l'axe $\vec{u}$ dans le sens
196 trigonométrique. Nous allons donc utiliser ces quaternions unitaires
197 pour représenter les mouvements du diffractomètre.
199 Alors que dans le plan 2D une simple multiplication entre un nombre
200 complex et le nombre $e^{i\theta}$ permet de calculer simplement la
201 rotation d'angle $\theta$ autour de l'origine, dans l'espace 3D
202 l'expression équivalente est:
206 où $q$ est le quaternion de norme 1 représentant la rotation dans
207 l'espace et $z$ le quaternion représentant le vecteur qui subit la
208 rotation (sa partie réelle est nulle).
210 Dans le cas des quaternions de norme 1, il est très facile de calculer
211 $q^{-1}$. En effet l'inverse d'une rotation d'angle $\theta$ est la
212 rotation d'angle $-\theta$. On a donc directement:
214 $$q^{-1}=[\cos\frac{-\theta}{2},\sin\frac{-\theta}{2}\vec{u}]=[\cos\frac{\theta}{2},-\sin\frac{\theta}{2}\vec{u}]=q^{*}$$
216 Le passage aux matrices de rotation se fait par la formule suivante
220 a{{}^2}+b{{}^2}-c{{}^2}-d{{}^2} & 2bc-2ad & 2ac+2bd\\
221 2ad+2bc & a{{}^2}-b{{}^2}+c{{}^2}-d{{}^2} & 2cd-2ab\\
222 2bd-2ac & 2ab+2cd & a{{}^2}-b{{}^2}-c{{}^2}+d{{}^2}
225 La composition de rotation se fait simplement en multipliant les
226 quaternions entre eux. Si l'on à $q$
228 ** Modes de fonctionnement
229 ** Equations fondamentales
231 Le problème que nous devons résoudre est de calculer pour une famille de
232 plan $(h,k,l)$ donné, les angles de rotation du diffractomètre qui
233 permettent de le mettre en condition de diffraction. Il faut donc
234 exprimer les relations mathématiques qui lient les différents angles
235 entre eux lorsque la condition de Bragg est vérifiée. L'équation
236 fondamentale est la suivante:
239 \left(\prod_{i}S_{i}\right)\cdot U\cdot B\cdot\vec{h} & =\left(\prod_{j}D_{j}-I\right)\cdot\vec{k_{i}}\\
240 R\cdot U\cdot B\cdot\vec{h} & =\vec{Q}
243 ou $\vec{h}$ est le vecteur $(h,k,l)$, $\vec{k_{i}}$ est le vecteur
244 incident, $S_{i}$ les matrices de rotations des mouvements liés à
245 l'échantillon, $D_{j}$ les matrices de rotation des mouvements liés au
246 détecteur, $I$ la matrice identité, $U$ la matrice d'orientation du
247 cristal par rapport au repère de l'axe sur lequel ce dernier est monté
248 et $B$ la matrice de passage d'un repère non orthonormé ( celui du
249 crystal réciproque) à un repère orthonormé.
253 Si l'on connaît les paramètres cristallins du cristal étudié, il est
254 très simple de calculer $B$:
258 a^{\star} & b^{\star}\cos\gamma^{\star} & c^{\star}\cos\beta^{\star}\\
259 0 & b^{\star}\sin\gamma^{\star} & -c^{\star}\sin\beta^{\star}\cos\alpha\\
265 Il existe plusieurs façons de calculer $U$. Busing et Levy en a proposé
266 plusieurs. Nous allons présenter celle qui nécessite la mesure de
267 seulement deux réflections ainsi que la connaissance des paramètres
268 cristallins. Cette façon de calculer la matrice d'orientation $U$, peut
269 être généralisée à n'importe quel diffractomètre pour peu que la
270 description des axes de rotation permette d'obtenir la matrice de
271 rotation de la machine $R$ et le vecteur de diffusion $\vec{Q}$.
273 Il est également possible de calculer $U$ sans la connaîssance des
274 paramètres cristallins. il faut alors faire un affinement des
275 paramètres. Cela revient à minimiser une fonction. Nous allons utiliser
276 la méthode du simplex pour trouver ce minimum et donc ajuster l'ensemble
277 des paramètres cristallins ainsi que la matrice d'orientation.
279 *** Algorithme de Busing Levy
281 L'idée est de se placer dans le repère de l'axe sur lequel est monté
282 l'échantillon. On mesure deux réflections $(\vec{h}_{1},\vec{h}_{2})$
283 ainsi que leurs angles associés. Cela nous permet de calculer $R$ et
284 $\vec{Q}$ pour chacune de ces reflections. nous avons alors ce système:
287 U\cdot B\cdot\vec{h}_{1} & = & \tilde{R}_{1}\cdot\vec{Q}_{1}\\
288 U\cdot B\cdot\vec{h}_{2} & = & \tilde{R}_{2}\cdot\vec{Q}_{2}
291 De façon à calculer facilement $U$, il est intéressant de définir deux
292 trièdres orthonormé $T_{\vec{h}}$ et $T_{\vec{Q}}$ à partir des vecteurs
293 $(B\vec{h}_{1},B\vec{h}_{2})$ et
294 $(\tilde{R}_{1}\vec{Q}_{1},\tilde{R}_{2}\vec{Q}_{2})$. On a alors très
297 $$U\cdot T_{\vec{h}}=T_{\vec{Q}}$$
301 $$U=T_{\vec{Q}}\cdot\tilde{T}_{\vec{h}}$$
303 *** Affinement par la méthode du simplex
305 Dans ce cas nous ne connaissons pas la matrice $B$, il faut donc mesurer
306 plus que deux réflections pour ajuster les 9 paramètres. Six paramètres
307 pour le crystal et trois pour la matrice d'orientation $U$. Les trois
308 paramètres qui permennt de representer $U$ sont en fait les angles
309 d'euler. il faut donc être en mesure de passer d'une représentation
310 eulérien à cette matrice :math::U et réciproquement.
312 $$U=X\cdot Y\cdot Z$$
314 où $X$ est la matrice rotation suivant l'axe Ox et le premier angle
315 d'Euler, $Y$ la matrice de rotation suivant l'axe Oy et le deuxième
316 angle d'Euler et $Z$ la matrice du troisième angle d'Euler pour l'axe
319 $$\begin{tabular}{ccc}
320 $X$ & $Y$ & $Z$\tabularnewline
345 BDE+AF & -BDF+AE & -BC\\
346 -ADE+BF & ADF+BE & AC
349 Il est donc facile de passer des angles d'Euler à la matrice
352 Il faut maintenant faire la transformation inverse de la matrice $U$
353 vers les angles d'euler.
355 ** Diffractomètre 4 Cercle (3S+1D) Eulerien
357 Pour ce diffractomètres, les matrices de rotations des différents axes
360 $$\begin{tabular}{cccc}
361 $\Omega$ & $\chi$ & $\Phi$ & $2\Theta$\tabularnewline
363 \cos\omega & 0 & -\sin\omega\\
365 \sin\omega & 0 & \cos\omega
370 0 & \cos\chi & -\sin\chi\\
371 0 & \sin\chi & \cos\chi
375 \cos\phi & 0 & -\sin\phi\\
377 \sin\phi & 0 & \cos\phi
381 \cos2\theta & 0 & -\sin2\theta\\
383 \sin2\theta & 0 & \cos2\theta
387 On obtient alors la matrice de rotation de la machine
395 \cos\omega\cos\phi-\cos\chi\sin\omega\sin\phi & -\sin\chi\sin\omega & -\cos\omega\sin\phi-\cos\chi\sin\omega\cos\phi\\
396 -\sin\chi\sin\phi & \cos\chi & -\sin\chi\cos\phi\\
397 \sin\omega\cos\phi-\cos\chi\cos\omega\sin\phi & -\sin\chi\cos\omega & -\sin\omega\sin\phi-\cos\chi\cos\omega\cos\phi
400 De la même façon on peut calculer le vecteur diffusion en fonction des
403 $$\vec{Q}=\left(2\Theta-I\right)\cdot\vec{k}_{i}$$
405 où $I$ est la matrice identité. Finalement:
407 $$\vec{Q}=k_{i}\left(\begin{array}{c}
413 L'équation fondamentale nous permet d'écrire:
415 $$U\cdot B\cdot\vec{h}=\tilde{R}\cdot\vec{Q}$$
417 Cette équation est de 4 inconnus pour seulement 3 équations. Il faut
418 donc imposer des contraintes pour résoudre ce système et ainsi
419 d'orienter le diffractomètre. Ces différentes contraintes définissent
420 les modes de fonctionnement des diffractomètres. Dans la suite nous
421 allons nous efforcer de trouver l'ensemble des solutions possibles pour
422 les différents modes et non pas une seule solution. Ceci afin de laisser
423 le choix suivant certaines stratégies à l'utilisateur d'utiliser telle
424 ou telle solution plutôt qu'une autre.
428 Dans ce mode on choisit d'avoir:
432 Le système s'écrit alors simplement:
435 h_{\phi} & = & 2k_{i}\sin\theta\cos\chi\sin\phi\\
436 k_{\phi} & = & 2k_{i}\sin\theta\sin\chi\\
437 l_{\phi} & = & 2k_{i}\sin\theta\cos\chi\cos\phi
442 $$h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}=4k_{i}\sin^{2}\theta$$
444 où $k_{i}=\frac{\tau}{\lambda}$. donc on peut écrire:
446 $$\left|\sin\theta\right|=\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$$
448 il faut donc enviseager les deux possibilité selon que $\theta$ est
449 positif ou bien négatif.
453 On peut alors écrire:
455 $$\sin\chi=-\frac{k_{\phi}}{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}$$
457 puis en utilisant le relation bien connue $\cos^{2}+\sin^{2}=1$ on a:
459 $$\cos^{2}\chi=\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}$$
461 Il faut une fois de plus faire un choix selon que $\cos\chi$ est positif
466 $$\cos\chi=-\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}$$
470 $$\cos\chi=\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}$$
474 On peut alors écrire:
476 $$\sin\chi=\frac{k_{\phi}}{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}$$
478 puis en utilisant le relation bien connue $\cos^{2}+\sin^{2}=1$ on a:
480 $$\cos^{2}\chi=\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}$$
482 Il faut une fois de plus faire un choix selon que $\cos\chi$ est positif
487 $$\cos\chi=-\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}$$
491 $$\cos\chi=\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}$$
493 La résolution du système donne alors 4 quadruplets de solutions:
495 $$\begin{tabular}{c|c|c|c}
496 $\omega$ & $\chi$ & $\phi$ & $2\theta$\tabularnewline
498 $-\theta$ & $\arctan2(-k_{\phi},-\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(h_{\phi},l_{\phi})$ & $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
499 $-\theta$ & $\arctan2(-k_{\phi},\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi},-l_{\phi})$ & $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
500 $\theta$ & $\arctan2(k_{\phi},-\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi},-l_{\phi})$ & $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
501 $\theta$ & $\arctan2(k_{\phi},\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(h_{\phi},l_{\phi})$ & $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
506 Ce mode consiste à décaler $\omega$ par rapport à $\theta$ d'une valeur
511 Le système s'écrit alors comme suit:
514 h_{\phi} & = & 2k_{i}\sin\theta\left(\cos C\cos\chi\sin\phi+\sin C\cos\phi\right)\\
515 k_{\phi} & = & 2k_{i}\sin\theta\cos C\sin\chi\\
516 l_{\phi} & = & 2k_{i}\sin\theta\left(\cos C\cos\chi\cos\phi-\sin C\sin\phi\right)
521 $$h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}=4k_{i}\sin^{2}\theta$$
523 La résolution donne 4 quadruplets de solutions:
525 $$\begin{tabular}{ccc}
526 $\omega$ & $\chi$ & $\phi$\tabularnewline
528 $-\theta+C$ & $\arctan2(\frac{-k_{\phi}}{\cos C},-\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
529 $-\theta+C$ & $\arctan2(\frac{-k_{\phi}}{\cos C},\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
530 $\theta+C$ & $\arctan2(\frac{k_{\phi}}{\cos C},-\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
531 $\theta+C$ & $\arctan2(\frac{k_{\phi}}{\cos C},\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
535 $2\theta$\tabularnewline
537 $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
538 $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
539 $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
540 $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
545 *** Mode omega constant
547 Dans ce mode on choisit de garder $\omega$ toujours constant:
551 Le système s'écrit alors comme suit:
554 h_{\phi} & = & 2k_{i}\sin\theta\left(\cos(C-\theta)\cos\chi\sin\phi+\sin(C-\theta)\cos\phi\right)\\
555 k_{\phi} & = & 2k_{i}\sin\theta\cos(C-\theta)\sin\chi\\
556 l_{\phi} & = & 2k_{i}\sin\theta\left(\cos(C-\theta)\cos\chi\cos\phi-\sin(C-\theta)\sin\phi\right)
559 La résolution donne 4 quadruplets de solutions:
561 $$\begin{tabular}{ccc}
562 $\omega$ & $\chi$ & $\phi$\tabularnewline
564 $-\theta+C$ & $\arctan2\left(-k_{\phi},-\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
565 $-\theta+C$ & $\arctan2\left(-k_{\phi},\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
566 $\theta+C$ & $\arctan2\left(k_{\phi},-\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
567 $\theta+C$ & $\arctan2\left(k_{\phi},\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
571 $2\theta$\tabularnewline
573 $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
574 $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
575 $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
576 $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
580 This section describe the calculations done by the library for the
581 different kind of pseudo axes.
583 ** Eulerians to Kappa angles
588 \kappa_\omega & = & \omega - p + \frac{\pi}{2} \\
589 \kappa & = & 2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
590 \kappa_\phi & = & \phi - p - \frac{\pi}{2}
596 \kappa_\omega & = & \omega - p - \frac{\pi}{2} \\
597 \kappa & = & -2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
598 \kappa_\phi & = & \phi - p + \frac{\pi}{2}
603 $$p = \arcsin\left(\frac{\tan\frac{\chi}{2}}{\tan\alpha}\right);$$
605 and $\alpha$ is the angle of the kappa axis with the $\vec{y}$ axis.
607 ** Kappa to Eulerians angles
612 \omega & = & \kappa_\omega + p - \frac{\pi}{2} \\
613 \chi & = & 2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
614 \phi & = & \kappa_\phi + p + \frac{\pi}{2}
620 \omega & = & \kappa_\omega + p + \frac{\pi}{2} \\
621 \chi & = & -2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
622 \phi & = & \kappa_\phi + p - \frac{\pi}{2}
627 $$p = \arctan\left(\tan\frac{\kappa}{2} \cos\alpha\right)$$
629 #+CAPTION: $\omega = 0$, $\chi = 0$, $\phi = 0$, 1st solution
631 [[../../figures/e2k_1.png]]
632 #+CAPTION: $\omega = 0$, $\chi = 0$, $\phi = 0$, 2nd solution
634 [[../../figures/e2k_2.png]]
635 #+CAPTION: $\omega = 0$, $\chi = 90$, $\phi = 0$, 1st solution
637 [[../../figures/e2k_3.png]]
638 #+CAPTION: $\omega = 0$, $\chi = 90$, $\phi = 0$, 2nd solution
640 [[../../figures/e2k_4.png]]
643 [[../../figures/qper_qpar.png]]
644 this pseudo axis engine compute the perpendicular
645 ($\left|\left|\vec{Q_\text{per}}\right|\right|$) and parallel
646 ($\left|\left|\vec{Q_\text{par}}\right|\right|$) contribution of
647 $\vec{Q}$ relatively to the surface of the sample defined by the
651 \vec{q} & = & \vec{k_\text{f}} - \vec{k_\text{i}} \\
652 \vec{q} & = & \vec{q_\text{per}} + \vec{q_\text{par}} \\
653 \vec{q_\text{per}} & = & \frac{\vec{q} \cdot \vec{n}}{\left|\left|\vec{n}\right|\right|} \frac{\vec{n}}{\left|\left|\vec{n}\right|\right|}
655 * Les Diffractomètres
658 Nous allons nous inspirer du modèle de Busin et Levy pour décrire notre
659 diffractomètre. Les sens de rotation sont respectés mais le repère
660 directe est choisi de façon à correspondre au repère de laboratoire de
661 la ligne CRYSTAL du synchrotron Soleil. Les photons-X se propagent
662 suivant le vecteur $\vec{x}$ et la direction verticale est suivant le
663 vecteur $\vec{z}$. Ce diffractomètre est de type verticale (le vecteur
664 de diffusion $\vec{Q}$ est dans le plan xOz). Les angles permettant de
665 décrire la configuration du diffractomètre sont présentés sur la
666 figure~ref{[[cap:3S+1D]]}.
668 #+CAPTION: Dénomination des angles du diffractomètre 3S+1D
669 Eulérien.label{[[cap:3S+1D]]}
671 [[../../figures/3S+1D.png]]
674 Nous allons nous inspirer du modèle de You pour notre diffractomètre
675 (fig.~ref{[[cap:4S+2D]]}) ici présenté tous les angles mis à zéro. Les
676 rayons-X arrivent suivant le vecteur $vec{x}$ (le repère est différent
679 #+CAPTION: Dénomination des angles du diffractomètre 4S+2D
680 Eulérien.label{[[cap:4S+2D]]}
682 [[../../figures/4S+2D.png]]
683 Le principe des calcules de You est d'exprimer dans le repère du
684 laboratoire le vecteur diffusion $\vec{Q}$ de deux façons différentes.
685 Une première en utilisant les angles du goniomètre 4S puis une à partir
686 des angles du détecteur 2D et de la connaissance des coordonnées du
687 vecteur incident. En égalant les deux expressions, il obtient un système
688 d'équation à 6 inconnus mais seulement 3 équations. Pour être à même de
689 résoudre le système il faut fixer des contraintes supplémentaire. C'est
690 ce que l'on appel les modes de fonctionnement du diffractomètre. Il est
691 commode de définir d'autres angles que ceux du diffractomètre
692 relativement à des vecteurs caractéristiques tel que le vecteur de
693 diffusion $\vec{Q}$ ou un vecteur pointant dans une direction
694 particulière du cristal $\vec{n}$. Cette direction peut-être soit lié à
695 la cristallographie du cristal soit à sa forme (une normale à une face).
696 La figure~ref{[[cap:Pseudo-Angles-li=0000E9s]]} représente les angles
697 liés au vecteur de diffusion et à ce vecteur de référence. Tout d'abord
698 $\theta$ (angle entre $\vec{Q}$ et le plan $yz$) et qui correspond à
699 l'angle de Bragg. $\vartheta$ qui est l'angle azimutal que fait la
700 projection de $\vec{Q}$ sur le plan $yz$ et la direction $+y$
701 (fig~ref{[[cap:Pseudo-Angles-li=0000E9s}a]]). Il y a ensuite les angles
702 $\alpha$ et $\varphi$ définits comme précédemment mais pour le vecteur
703 de référence $\vec{n}$ (fig~ref{[[cap:Pseudo-Angles-li=0000E9s}b]]). Et
704 finalement les angles $tau$ (angle entre $\vec{Q}$ et $\vec{n}$) et
705 $\psi$ qui correspond à la rotation de $\vec{n}$ autour du vecteur de
706 diffusion $\vec{Q}$ (fig~ref{[[cap:Pseudo-Angles-li=0000E9s}c]]).
707 L'origine de cet angle $psi$ est prise à zéro lorsque le vecteur
708 $\vec{n}$ est dans le plan de diffraction (plan contenant $\vec{Q}$ et
709 $\vec{k_{i}}$) (fig~ref{[[cap:Pseudo-Angles-li=0000E9s}d]]).
711 #+CAPTION: Pseudo angles $\theta$ et $\vartheta$ liés à $\vec{Q}$
713 [[../../figures/4S+2D_reciprocal.png]]
714 #+CAPTION: Pseudo angles $\alpha$ et $\phi$ liés à $\vec{n}$
716 [[../../figures/4S+2D_reciprocal2.png]]
717 #+CAPTION: Pseudo angles $\tau$ et $\psi$ liés à $\vec{n}$ relativement
718 à $\vec{Q}$ et le plan de diffraction
720 [[../../figures/4S+2D_reciprocal3.png]]
721 #+CAPTION: Pseudo Angles liés au vecteur de diffusion $\vec{Q}$ et à
724 [[../../figures/4S+2D_reciprocal4.png]]
725 Il est alors possible d'exprimer ces pseudos angles en fonction des
726 angles physique du diffractomètre.
728 ** Eulerian 4 circles
730 #+CAPTION: Schematic view of the diffractometer.
732 [[../../../figures/3S+1D.png]]
735 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
736 - 3 axes for the sample
738 - *omega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
739 - *chi* : rotating around the $\vec{x}$ direction (1, 0, 0)
740 - *phi* : rotating around the $-\vec{y}$ direction (0, -1, 0)
742 - 1 axis for the detector
744 - *tth* : rotation around the $-\vec{y}$ direction (0, -1, 0)
750 PseudoAxes provided : *h*, *k* and *l*
754 - Axes: *omega*, *chi*, *phi*, *tth*
755 - Parameters : No parameter
757 This mode add the bissector constrain =tth = 2 * omega=. In this mode
758 the *chi* circle containt the vector of diffusion $\vec{Q}$. So it is
759 easy to know the orientation of the hkl plan.
761 - mode *constant\_omega*
763 - Axes : *chi*, *phi*, *tth*
764 - Parameters : No parameter
766 This mode do not move the current *omega* axis.
768 - mode *constant\_chi*
770 - Axes : *omega*, *phi*, *tth*
771 - Parameters : No parameter
773 This mode do not move the current *chi* axis.
775 - mode *constant\_phi*
777 - Axes related : *omega*, *chi*, *tth*
778 - Parameters : No parameter
780 This mode do not move the current *phi* axis.
782 - mode *double\_diffraction*
784 - Axes : *omega*, *chi*, *phi*, *tth*
785 - Parameters : *h2*, *k2*, *l2*
787 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
788 condition. This is usefull sometimes when you want to explore two
789 bragg peaks without moving your sample.
791 - mode *psi\_constant*
793 - Axes : *omega*, *chi*, *phi*, *tth*
794 - Parameters : *h2*, *k2*, *l2*, *psi*
796 This mode allow to fix the value of the pseudo axis *psi* at a
797 constant value when you move around an *h*, *k* , *l* position. The
798 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
799 of the *psi* pseudo axis value.
801 You can retrive and =freeze= the current value of the *psi* pseudo
802 axis value into the *psi* parameter when you initialize the mode. But
803 you can also write directly the value of the desired *psi* parameter.
807 PseudoAxis provided : *psi*
811 - Axes : *omega*, *chi*, *phi*, *tth*
812 - Parameters : *h1*, *k1*, *l1*
816 PseudoAxis provided : *q*
818 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$
823 - Parameters : no parameter
825 ** Eulerian 6 circles
827 #+CAPTION: Schematic view of the diffractometer.
829 [[../../../figures/4S+2D.png]]
832 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
833 - 4 axes for the sample
835 - *mu* : rotating around the $\vec{z}$ direction (0, 0, 1)
836 - *omega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
837 - *chi* : rotating around the $\vec{x}$ direction (1, 0, 0)
838 - *phi* : rotating around the $-\vec{y}$ direction (0, -1, 0)
840 - 2 axes for the detector
842 - *gamma* : rotation around the $\vec{z}$ direction (0, 0, 1)
843 - *delta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
849 PseudoAxes provided : *h*, *k* and *l*
851 - mode *bissector\_vertical*
853 - Axes: *omega*, *chi*, *phi*, *delta*
854 - Parameters : No parameter
856 This mode add the bissector constrain =delta = 2 * omega=. In this
857 mode the *chi* circle containt the vector of diffusion $\vec{Q}$. So
858 it is easy to know the orientation of the hkl plan.
860 - mode *constant\_omega\_vertical*
862 - Axes: *"chi"*, *"phi"*, *"delta"*
863 - Parameters : no parameter
865 This mode do not move the *omega* axis.
867 - mode *constant\_chi\_vertical*
869 - Axes: *"omega"*, *"phi"*, *"delta"*
870 - Parameters : no parameter
872 This mode do not move the *chi* axis.
874 - mode *constant\_phi\_vertical*
876 - Axes : *"omega"*, *"chi"*, *"delta"*
877 - Parameters : no parameter
879 This mode do not move the *phi* axis.
881 - mode : *lifting\_detector\_phi*
883 - Axes : *"phi"*, *"gamma"*, *"delta"*
884 - Parameters : No Parameters
886 - mode : *lifting\_detector\_omega*
888 - Axes : *"omega"*, *"gamma"*, *"delta"*
889 - Parameters : No Parameters
891 - mode : *lifting\_detector\_mu*
893 - Axes : *"mu"*, *"gamma"*, *"delta"*
894 - Parameters : No Parameters
896 - mode : *double\_diffraction vertical*
898 - Axes : *"omega"*, *"chi"*, *"phi"*, *"delta"*
899 - Parameters : *h2*, *k2*, *l2*
901 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
902 condition. This is usefull sometimes when you want to explore two
903 bragg peaks without moving your sample.
905 - mode : *bissector\_horizontal*
907 - Axes : *"mu"*, *"omega"*, *"chi"*, *"phi"*, *"gamma"*
908 - Parameters : No parameters
910 - mode : *double\_diffraction\_horizontal*
912 - Axes : *"mu"*, *"omega"*, *"chi"*, *phi*, *"gamma"*
913 - Parameters : *h2*, *k2*, *l2*
915 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
916 condition. This is usefull sometimes when you want to explore two
917 bragg peaks without moving your sample.
919 - mode : *psi\_constant\_vertical*
921 - Axes : *"omega"*, *"chi"*, *phi*, *"delta"*
922 - Parameters : *h2*, *k2*, *l2*, *psi*
924 This mode allow to fix the value of the pseudo axis *psi* at a
925 constant value when you move around an *h*, *k* , *l* position. The
926 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
927 of the *psi* pseudo axis value.
929 You can retrive and =freeze= the current value of the *psi* pseudo
930 axis value into the *psi* parameter when you initialize the mode. But
931 you can also write directly the value of the desired *psi* parameter.
933 - mode : *psi\_constant\_horizontal*
935 - Axes : *"omega"*, *"chi"*, *phi*, *"gamma"*
936 - Parameters : *h2*, *k2*, *l2*, *psi*
938 This mode allow to fix the value of the pseudo axis *psi* at a
939 constant value when you move around an *h*, *k* , *l* position. The
940 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
941 of the *psi* pseudo axis value.
943 You can retrive and =freeze= the current value of the *psi* pseudo
944 axis value into the *psi* parameter when you initialize the mode. But
945 you can also write directly the value of the desired *psi* parameter.
947 - mode *constant\_mu\_horizontal*
949 - Axes : *"chi"*, *"phi"*, *"gamma"*
950 - Parameters : no parameter
952 This mode do not move the *mu* axis.
956 PseudoAxis provided : *psi*
958 - mode *psi\_vertical*
960 - Axes : *komega*, *kappa*, *kphi*, *delta*
961 - Parameters : *h1*, *k1*, *l1*
963 The (*h1*, *k1*, *l1*) vector is used as a reference for the
964 computation of the *psi* pseudo axis value.
968 PseudoAxis provided : *q*, *alpha*
970 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
971 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
972 angles is the $\vec{y}$ vector, and the positive rotation along
977 - Axes : *"gamma"*, *"delta"*
978 - Parameters : no parameter
980 ** Kappa 4 circles vertical
982 #+CAPTION: Schematic view of the diffractometer.
984 [[../../../figures/k4cv.png]]
987 For this geometry there is a special parameters called $\alpha$ which is
988 the angle between the kappa rotation axis and the $\vec{y}$ direction.
990 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
991 - 3 axes for the sample
993 - *komega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
994 - *kappa* : rotating around the $\vec{x}$ direction (0,
995 $-\cos\alpha$, $-\sin\alpha$)
996 - *kphi* : rotating around the $-\vec{y}$ direction (0, -1, 0)
998 - 1 axis for the detector
1000 - *tth* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1006 PseudoAxes provides : *"omega"*, *"chi"*, *"phi"*
1010 - Axes : *komega*, *kappa*, *kphi*
1011 - Parameters : *"solution"*
1013 When you compute the eulerians values from the kappa axes values,
1014 there is two possibilities, so the *"solution"* parameter when set 0
1015 or 1 allow to switch from one solution to the other.
1019 PseudoAxes provided : *h*, *k* and *l*
1023 - Axes: *komega*, *kappa*, *kphi*, *tth*
1024 - Parameters : No parameter
1026 This mode add the bissector constrain =tth = 2 * omega=. In this mode
1027 the equivalent eulerian *chi* circle containt the vector of diffusion
1028 $\vec{Q}$. So it is easy to know the orientation of the hkl plan.
1030 - mode *constant\_omega*
1032 - Axes : *"komega"*, *"kappa"*, *"kphi"*, *"tth"*
1033 - Parameters : *"omega"*
1035 This mode do not move the equivalent eulerian *omega* axis, fixed by
1036 the parameter of the mode.
1038 - mode *constant\_chi*
1040 - Axes : *"komega"*, *"kappa"*, *"kphi"*, *"tth"*
1041 - Parameters : *"chi"*
1043 This mode do not move the equivalent eulerian *chi* axis fixed by the
1044 parameter of the mode.
1046 - mode *constant\_phi*
1048 - Axes related : *"komega"*, *"kappa"*, *"kphi"*, *"tth"*
1049 - Parameters : *"phi"*
1051 This mode do not move the equivalent eulerian *phi* axis fixed by the
1052 parameter of the mode.
1054 - mode *double\_diffraction*
1056 - Axes : *komega*, *kappa*, *kphi*, *tth*
1057 - Parameters : *h2*, *k2*, *l2*
1059 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
1060 condition. This is usefull sometimes when you want to explore two
1061 bragg peaks without moving your sample.
1063 - mode *psi\_constant*
1065 - Axes : *komega*, *kappa*, *kphi*, *tth*
1066 - Parameters : *h2*, *k2*, *l2*, *psi*
1068 This mode allow to fix the value of the pseudo axis *psi* at a
1069 constant value when you move around an *h*, *k* , *l* position. The
1070 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
1071 of the *psi* pseudo axis value.
1073 You can retrive and =freeze= the current value of the *psi* pseudo
1074 axis value into the *psi* parameter when you initialize the mode. But
1075 you can also write directly the value of the desired *psi* parameter.
1079 PseudoAxis provided : *psi*
1083 - Axes : *komega*, *kappa*, *kphi*, *tth*
1084 - Parameters : *h1*, *k1*, *l1*
1088 PseudoAxis provided : *q*
1090 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$
1095 - Parameters : no parameter
1099 #+CAPTION: Schematic view of the diffractometer.
1101 [[../../../figures/k6c.png]]
1104 For this geometry there is a special parameters called $\alpha$ which is
1105 the angle between the kappa rotation axis and the $\vec{y}$ direction.
1107 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1108 - 4 axes for the sample
1110 - *mu* : rotating around the $\vec{z}$ direction (0, 0, 1)
1111 - *komega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1112 - *kappa* : rotating around the $\vec{x}$ direction (0,
1113 $-\cos\alpha$, $-\sin\alpha$)
1114 - *kphi* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1116 - 2 axes for the detector
1118 - *gamma* : rotation around the $\vec{z}$ direction (0, 0, 1)
1119 - *delta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1125 PseudoAxes provides : *"omega"*, *"chi"*, *"phi"*
1129 - Axes : *komega*, *kappa*, *kphi*
1130 - Parameters : *"solution"*
1132 When you compute the eulerians values from the kappa axes values,
1133 there is two possibilities, so the *"solution"* parameter when set 0
1134 or 1 allow to switch from one solution to the other.
1138 PseudoAxes provided : *h*, *k* and *l*
1140 - mode *bissector\_vertical*
1142 - Axes: *komega*, *kappa*, *kphi*, *delta*
1143 - Parameters : No parameter
1145 This mode add the bissector constrain =tth = 2 * omega=. In this mode
1146 the equivalent eulerian *chi* circle containt the vector of diffusion
1147 $\vec{Q}$. So it is easy to know the orientation of the hkl plan.
1149 - mode *constant\_omega\_vertical*
1151 - Axes: *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1152 - Parameters : *omega*
1154 This mode do not move the equivalent eulerian *omega* axis.
1156 - mode *constant\_chi\_vertical*
1158 - Axes: *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1159 - Parameters : *chi*
1161 This mode do not move the equivalent eulerian *chi* axis.
1163 - mode *constant\_phi\_vertical*
1165 - Axes : *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1166 - Parameters : *phi*
1168 This mode do not move the equivalent eulerian *phi* axis.
1170 - mode : *lifting\_detector\_kphi*
1172 - Axes : *"kphi"*, *"gamma"*, *"delta"*
1173 - Parameters : No Parameters
1175 - mode : *lifting\_detector\_mu*
1177 - Axes : *"mu"*, *"gamma"*, *"delta"*
1178 - Parameters : No Parameters
1180 - mode : *double\_diffraction vertical*
1182 - Axes : *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1183 - Parameters : *h2*, *k2*, *l2*
1185 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
1186 condition. This is usefull sometimes when you want to explore two
1187 bragg peaks without moving your sample.
1189 - mode : *bissector\_horizontal*
1191 - Axes : *"mu"*, *"komega"*, *"kappa"*, *"kphi"*, *"gamma"*
1192 - Parameters : No parameters
1194 - mode : *constant\_phi\_horizontal*
1196 - Axes : *"mu"*, *"komega"*, *"kappa"*, *"kphi"*, *"gamma"*
1197 - Parameters : *phi*
1199 - mode : *horizontal kphi constant*
1201 - Axes : *"mu"*, *"komega"*, *"kappa"*, *"gamma"*
1202 - Parameters : no parameters
1204 - mode : *double\_diffraction\_horizontal*
1206 - Axes : *"mu"*, *"komega"*, *"kappa"*, *kphi*, *"gamma"*
1207 - Parameters : *h2*, *k2*, *l2*
1209 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
1210 condition. This is usefull sometimes when you want to explore two
1211 bragg peaks without moving your sample.
1213 - mode : *psi\_constant\_vertical*
1215 - Axes : *"komega"*, *"kappa"*, *kphi*, *"delta"*
1216 - Parameters : *h2*, *k2*, *l2*, *psi*
1218 This mode allow to fix the value of the pseudo axis *psi* at a
1219 constant value when you move around an *h*, *k* , *l* position. The
1220 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
1221 of the *psi* pseudo axis value.
1223 You can retrive and =freeze= the current value of the *psi* pseudo
1224 axis value into the *psi* parameter when you initialize the mode. But
1225 you can also write directly the value of the desired *psi* parameter.
1227 - mode : *constant\_incidence*
1229 - Axes : *"komega"*, *"kappa"*, *kphi*, *"gamma"*, *"delta"*
1230 - Parameters : *x*, *y*, *z*, *incidence*, *azimuth*
1232 This mode allow to work with a constant incidence of the incoming
1233 beam onto the sample surface. To use this mode you need to follow a
1238 - align your surface along a direction $\vec{n}$ (*x*, *y*, *z*)
1239 in the laboratory space, with your diffractometer.
1240 - initialize the mode, so it can remember the current
1241 diffractometer position for futur computation.
1242 - set the desired *incidence*
1243 - set the desired *azimuth* of the normal of the surface in the
1244 YOZ plane (azimuth = 0 -> $\vec{n}$ along $\vec{y}$)
1247 Now it is possible to do an HKL computation.
1251 PseudoAxis provided : *psi*
1253 - mode *psi\_vertical*
1255 - Axes : *komega*, *kappa*, *kphi*, *delta*
1256 - Parameters : *h1*, *k1*, *l1*
1258 The (*h1*, *k1*, *l1*) vector is used as a reference for the
1259 computation of the *psi* pseudo axis value.
1263 PseudoAxis provided : *q*, *alpha*
1265 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1266 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1267 angles is the $\vec{y}$ vector, and the positive rotation along
1272 - Axes : *"gamma"*, *"delta"*
1273 - Parameters : no parameter
1279 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1280 - 3 axes for the sample
1282 - *omega* : rotating around the $\vec{z}$ direction (0, -1, 0)
1283 - *chi* : rotating around the $\vec{x}$ direction (-1, 0, 0)
1284 - *phi* : rotating around the $\vec{z}$ direction (0, 0, 1)
1286 - 1 axis for the detector
1288 - *tth* : rotation around the $\vec{z}$ direction (0, -1, 0)
1294 PseudoAxes provided : *h*, *k* and *l*
1298 - Axes: *omega*, *chi*, *phi*, *tth*
1299 - Parameters : No parameter
1301 This mode add the bissector constrain =tth = 2 * omega=. In this mode
1302 the *chi* circle containt the vector of diffusion $\vec{Q}$. So it is
1303 easy to know the orientation of the hkl plan.
1305 - mode *constant\_omega*
1307 - Axes : *chi*, *phi*, *tth*
1308 - Parameters : No parameter
1310 This mode do not move the current *omega* axis.
1312 - mode *constant\_chi*
1314 - Axes : *omega*, *phi*, *tth*
1315 - Parameters : No parameter
1317 This mode do not move the current *chi* axis.
1319 - mode *constant\_phi*
1321 - Axes related : *omega*, *chi*, *tth*
1322 - Parameters : No parameter
1324 This mode do not move the current *phi* axis.
1326 - mode *double\_diffraction*
1328 - Axes : *omega*, *chi*, *phi*, *tth*
1329 - Parameters : *h2*, *k2*, *l2*
1331 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
1332 condition. This is usefull sometimes when you want to explore two
1333 bragg peaks without moving your sample.
1335 - mode *psi\_constant*
1337 - Axes : *omega*, *chi*, *phi*, *tth*
1338 - Parameters : *h2*, *k2*, *l2*, *psi*
1340 This mode allow to fix the value of the pseudo axis *psi* at a
1341 constant value when you move around an *h*, *k* , *l* position. The
1342 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
1343 of the *psi* pseudo axis value.
1345 You can retrive and =freeze= the current value of the *psi* pseudo
1346 axis value into the *psi* parameter when you initialize the mode. But
1347 you can also write directly the value of the desired *psi* parameter.
1351 PseudoAxis provided : *psi*
1355 - Axes : *omega*, *chi*, *phi*, *tth*
1356 - Parameters : *h1*, *k1*, *l1*
1360 PseudoAxis provided : *q*
1362 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$
1367 - Parameters : no parameter
1369 ** SOLEIL SIXS MED1+2
1373 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1374 - 2 axes for the sample
1376 - *pitch* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1377 - *mu* : rotation around the $\vec{z}$ direction (0, 0, 1)
1379 - 3 axis for the detector
1381 - *pitch* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1382 - *gamma* : rotation around the $\vec{z}$ direction (0, 0, 1)
1383 - *delta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1389 PseudoAxes provided : *h*, *k* and *l*
1391 - mode *pitch\_fixed*
1393 - Axes : *mu*, *gamma*, *delta*
1394 - Parameters : No parameter
1398 PseudoAxis provided : *q*, *alpha*
1400 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1401 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1402 angles is the $\vec{y}$ vector, and the positive rotation along
1407 - Axes : *"gamma"*, *"delta"*
1408 - Parameters : no parameter
1410 ** SOLEIL SIXS MED2+2
1414 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1415 - 3 axes for the sample
1417 - *beta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1418 - *mu* : rotation around the $\vec{z}$ direction (0, 0, 1)
1419 - *omega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1421 - 3 axis for the detector
1423 - *beta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1424 - *gamma* : rotation around the $\vec{z}$ direction (0, 0, 1)
1425 - *delta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1431 PseudoAxes provided : *h*, *k* and *l*
1435 - Axes : *omega*, *gamma*, *delta*
1436 - Parameters : No parameter
1438 - mode *reflectivity*
1440 - Axes : *mu*, *omega*, *gamma*, *delta*
1441 - Parameters : No parameter
1443 This mode add the reflectivity constraint =2*mu = gamma=. The
1444 incomming beam angle and the outgoing beam angle are equals.
1448 PseudoAxis provided : *q*, *alpha*
1450 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1451 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1452 angles is the $\vec{y}$ vector, and the positive rotation along
1457 - Axes : *"gamma"*, *"delta"*
1458 - Parameters : no parameter
1460 ** SOLEIL SIXS MED2+3
1464 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1465 - 3 axes for the sample
1467 - *beta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1468 - *mu* : rotation around the $\vec{z}$ direction (0, 0, 1)
1469 - *omega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1471 - 3 axis for the detector
1473 - *beta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1474 - *gamma* : rotation around the $\vec{z}$ direction (0, 0, 1)
1475 - *delta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1476 - *eta\_a* : rotation around the $-\vec{x}$ direction (-1, 0, 0)
1482 PseudoAxes provided : *h*, *k* and *l*
1484 - mode *mu\_eta\_a\_fixed*
1486 - Axes : *omega*, *gamma*, *delta*
1487 - Parameters : No parameter
1491 - Axes : *mu*, *omega*, *gamma*, *eta\_a*
1492 - Parameters : No parameter
1494 This mode add the slits constant orientation compare to the surface
1495 of the sample, which is along the *omega* axis.
1499 PseudoAxis provided : *q*, *alpha*
1501 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1502 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1503 angles is the $\vec{y}$ vector, and the positive rotation along
1508 - Axes : *"gamma"*, *"delta"*
1509 - Parameters : no parameter
1513 PseudoAxis provided : *qper*, *qpar*
1515 where *qper* and *qpar* are the perpendicular and parallel composants of
1516 the $|\vec{Q}|$ vector. projected respectively to the surface vector of
1522 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1523 - 4 axes for the sample
1525 - *mu* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1526 - *omega* : rotation around the $\vec{z}$ direction (0, 0, 1)
1527 - *chi* : rotating around the $\vec{x}$ direction (1, 0, 0)
1528 - *phi* : rotating around the $\vec{z}$ direction (0, 0, 1)
1530 - 3 axis for the detector
1532 - *mu* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1533 - *delta* : rotation around the $\vec{z}$ direction (0, 0, 1)
1534 - *gamma* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1540 PseudoAxes provided : *h*, *k* and *l*
1542 - mode *zaxis + alpha-fixed*
1544 - Axes : *"omega"*, *"gamma"*, *"delta"*
1545 - Parameters : No parameter
1547 - mode *zaxis + beta-fixed*
1549 - Axes : *"mu"*, *"omega"*, *"delta"*
1550 - Parameters : No parameter
1552 - mode *zaxis + alpha=beta*
1554 - Axes : *"mu"*, *"omega"*, *"gamma"*, *"delta"*
1555 - Parameters : No parameter
1557 This mode add the =mu = gamma= constrain.
1559 - mode *4-circles bissector\_horizontal*
1561 - Axes: *"omega"*, *"chi"*, *"phi"*, *"delta"*
1562 - Parameters : No parameter
1564 This mode add the bissector constrain =delta = 2 * omega=. In this
1565 mode the eulerian *"chi"* circle containt the vector of diffusion
1566 $\vec{Q}$. So it is easy to know the orientation of the hkl plan.
1568 - mode *4-circles constant\_omega\_horizontal*
1570 - Axes: *"chi"*, *"phi"*, *"delta"*
1571 - Parameters : No parameter
1573 This mode do not move the *"omega"* axis.
1575 - mode *4-circles constant\_chi\_horizontal*
1577 - Axes: *"omega"*, *"phi"*, *"delta"*
1578 - Parameters : No parameter
1580 This mode do not move the *"chi"* axis.
1582 - mode *4-circles constant\_phi\_horizontal*
1584 - Axes: *"omega"*, *"chi"*, *"delta"*
1585 - Parameters : No parameter
1587 This mode do not move the *"phi"* axis.
1589 ** SOLEIL SIRIUS KAPPA
1593 For this geometry there is a special parameters called $\alpha$ which is
1594 the angle between the kappa rotation axis and the $\vec{y}$ direction.
1596 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1597 - 4 axes for the sample
1599 - *mu* : rotating around the $-\vec{z}$ direction (0, 0, -1)
1600 - *komega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1601 - *kappa* : rotating around the $\vec{x}$ direction (0,
1602 $-\cos\alpha$, $-\sin\alpha$)
1603 - *kphi* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1605 - 2 axes for the detector
1607 - *delta* : rotation around the $-\vec{z}$ direction (0, 0, -1)
1608 - *gamma* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1614 PseudoAxes provides : *"omega"*, *"chi"*, *"phi"*
1618 - Axes : *komega*, *kappa*, *kphi*
1619 - Parameters : *"solution"*
1621 When you compute the eulerians values from the kappa axes values,
1622 there is two possibilities, so the *"solution"* parameter when set 0
1623 or 1 allow to switch from one solution to the other.
1627 PseudoAxes provided : *h*, *k* and *l*
1629 - mode *bissector\_vertical*
1631 - Axes: *komega*, *kappa*, *kphi*, *delta*
1632 - Parameters : No parameter
1634 This mode add the bissector constrain =tth = 2 * omega=. In this mode
1635 the equivalent eulerian *chi* circle containt the vector of diffusion
1636 $\vec{Q}$. So it is easy to know the orientation of the hkl plan.
1638 - mode *constant\_omega\_vertical*
1640 - Axes: *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1641 - Parameters : *omega*
1643 This mode do not move the equivalent eulerian *omega* axis.
1645 - mode *constant\_chi\_vertical*
1647 - Axes: *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1648 - Parameters : *chi*
1650 This mode do not move the equivalent eulerian *chi* axis.
1652 - mode *constant\_phi\_vertical*
1654 - Axes : *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1655 - Parameters : *phi*
1657 This mode do not move the equivalent eulerian *phi* axis.
1659 - mode : *lifting\_detector\_kphi*
1661 - Axes : *"kphi"*, *"gamma"*, *"delta"*
1662 - Parameters : No Parameters
1664 - mode : *lifting\_detector\_mu*
1666 - Axes : *"mu"*, *"gamma"*, *"delta"*
1667 - Parameters : No Parameters
1669 - mode : *double\_diffraction vertical*
1671 - Axes : *"komega"*, *"kappa"*, *"kphi"*, *"delta"*
1672 - Parameters : *h2*, *k2*, *l2*
1674 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
1675 condition. This is usefull sometimes when you want to explore two
1676 bragg peaks without moving your sample.
1678 - mode : *bissector\_horizontal*
1680 - Axes : *"mu"*, *"komega"*, *"kappa"*, *"kphi"*, *"gamma"*
1681 - Parameters : No parameters
1683 - mode : *constant\_phi\_horizontal*
1685 - Axes : *"mu"*, *"komega"*, *"kappa"*, *"kphi"*, *"gamma"*
1686 - Parameters : *phi*
1688 - mode : *horizontal kphi constant*
1690 - Axes : *"mu"*, *"komega"*, *"kappa"*, *"gamma"*
1691 - Parameters : no parameters
1693 - mode : *double\_diffraction\_horizontal*
1695 - Axes : *"mu"*, *"komega"*, *"kappa"*, *kphi*, *"gamma"*
1696 - Parameters : *h2*, *k2*, *l2*
1698 This mode put a second hkl vector (*h2*, *k2*, *l2*) in Bragg
1699 condition. This is usefull sometimes when you want to explore two
1700 bragg peaks without moving your sample.
1702 - mode : *psi\_constant\_vertical*
1704 - Axes : *"komega"*, *"kappa"*, *kphi*, *"delta"*
1705 - Parameters : *h2*, *k2*, *l2*, *psi*
1707 This mode allow to fix the value of the pseudo axis *psi* at a
1708 constant value when you move around an *h*, *k* , *l* position. The
1709 (*h2*, *k2*, *l2*) vector is used as a reference for the computation
1710 of the *psi* pseudo axis value.
1712 You can retrive and =freeze= the current value of the *psi* pseudo
1713 axis value into the *psi* parameter when you initialize the mode. But
1714 you can also write directly the value of the desired *psi* parameter.
1716 - mode : *constant\_incidence*
1718 - Axes : *"komega"*, *"kappa"*, *kphi*, *"gamma"*, *"delta"*
1719 - Parameters : *x*, *y*, *z*, *incidence*, *azimuth*
1721 This mode allow to work with a constant incidence of the incoming
1722 beam onto the sample surface. To use this mode you need to follow a
1727 - align your surface along a direction $\vec{n}$ (*x*, *y*, *z*)
1728 in the laboratory space, with your diffractometer.
1729 - initialize the mode, so it can remember the current
1730 diffractometer position for futur computation.
1731 - set the desired *incidence*
1732 - set the desired *azimuth* of the normal of the surface in the
1733 YOZ plane (azimuth = 0 -> $\vec{n}$ along $\vec{y}$)
1736 Now it is possible to do an HKL computation.
1740 PseudoAxis provided : *psi*
1742 - mode *psi\_vertical*
1744 - Axes : *komega*, *kappa*, *kphi*, *delta*
1745 - Parameters : *h1*, *k1*, *l1*
1747 The (*h1*, *k1*, *l1*) vector is used as a reference for the
1748 computation of the *psi* pseudo axis value.
1752 PseudoAxis provided : *q*, *alpha*
1754 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1755 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1756 angles is the $\vec{y}$ vector, and the positive rotation along
1761 - Axes : *"gamma"*, *"delta"*
1762 - Parameters : no parameter
1764 ** SOLEIL SIRIUS TURRET
1768 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1769 - 3 axes for the sample
1771 - *thetah* : rotating around the $-\vec{z}$ direction (0, 0, -1)
1772 - *alphay* : rotating around the $\vec{y}$ direction (0, 1, 0)
1773 - *alphax* : rotating around the $\vec{x}$ direction (1, 0, 0)
1775 - 2 axes for the detector
1777 - *delta* : rotation around the $-\vec{z}$ direction (0, 0, -1)
1778 - *gamma* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1784 PseudoAxes provided : *h*, *k* and *l*
1786 - mode : *lifting\_detector\_thetah*
1788 - Axes : *"thetah"*, *"delta"*, *"gamma"*
1789 - Parameters : No Parameters
1793 PseudoAxis provided : *q*, *alpha*
1795 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1796 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1797 angles is the $\vec{y}$ vector, and the positive rotation along
1802 - Axes : *"gamma"*, *"delta"*
1803 - Parameters : no parameter
1807 PseudoAxis provided : *qper*, *qpar*
1809 where *qper* and *qpar* are the perpendicular and parallel composants of
1810 the $|\vec{Q}|$ vector projected respectively to the surface vector
1811 $\vec{n}$ of coordinates $x$, $y$, $z$ of the sample expressed in the
1812 sample referential. The default value for $n$ is (0, 1, 0)
1814 - mode : *qper\_qpar*
1816 - Axes : *"delta"*, *"gamma"*
1817 - Parameters : *"x"*, *"y"*, *"z"*
1823 For this geometry the *mu* axis is common to the sample and the
1826 - xrays source fix allong the $\vec{x}$ direction (1, 0, 0)
1827 - 2 axes for the sample
1829 - *mu* : rotation around the $\vec{z}$ direction (0, 0, 1)
1830 - *omega* : rotating around the $-\vec{y}$ direction (0, -1, 0)
1832 - 3 axis for the detector
1834 - *mu* : rotation around the $\vec{z}$ direction (0, 0, 1)
1835 - *delta* : rotation around the $-\vec{y}$ direction (0, -1, 0)
1836 - *gamma* : rotation around the $\vec{z}$ direction (0, 0, 1)
1842 PseudoAxes provided : *h*, *k* and *l*
1846 - Axes : *omega*, *delta*, *gamma*
1847 - Parameters : No parameter
1849 - mode *reflectivity*
1851 - Axes : *mu*, *omega*, *delta*, *gamma*
1852 - Parameters : No parameter
1854 This mode add the reflectivity constraint =mu = gamma=. The incomming
1855 beam angle and the outgoing beam angle are equals.
1859 PseudoAxis provided : *q*, *alpha*
1861 where *q* is $|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}$ and
1862 *alpha* is the azimuth of $\vec{Q}$ in the =yz= plan. The origin of this
1863 angles is the $\vec{y}$ vector, and the positive rotation along
1868 - Axes : *"gamma"*, *"delta"*
1869 - Parameters : no parameter
1874 To get hkl, you can download the last stable version from sourceforge or
1875 if you want the latest development version use
1876 [[http://git.or.cz/][git]] or
1877 [[http://code.google.com/p/msysgit/downloads/list][msysgit]] on windows
1881 $ git clone git://repo.or.cz/hkl.git
1887 $ git clone http://repo.or.cz/r/hkl.git (slower)
1890 then checkout the next branch like this:
1894 $ git checkout -b next origin/next
1899 To build hkl you need [[http://www.python.org][Python 2.3+]] the
1900 [[http://www.gnu.org/software/gsl/][GNU Scientific Library 1.12]] and
1901 [[https://developer.gnome.org/glib/][GLib-2.0 >= 2.3.4]]:
1904 $ ./configure --disable-gui
1909 you can also build a GUI interfaces which use
1910 [[http://www.gtk.org][gtk]]:
1918 optionnaly you can build an experimental /libhkl3d/ library (no public
1919 API for now) which is used by the GUI to display and compute
1920 diffractometer collisions (only the /K6C/ model). To build it you need
1921 also [[https://projects.gnome.org/gtkglext/][gtkglext]] and
1922 [[http://bulletphysics.org/wordpress/][bullet 2.82]]:
1925 $ ./configure --enable-hkl3d
1930 if you want to work on the documentation you need the extra
1932 - [[http://www.gtk.org/gtk-doc/][gtk-doc]] for the api
1933 - [[http://sphinx.pocoo.org/][sphinx]] for the html and latex doc.
1934 - [[http://asymptote.sourceforge.net/][asymptote]] for the figures
1937 $ ./configure --enable-gtk-doc
1946 You can find the bug tracker here
1947 [[https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=hkl][libhkl]]
1957 You just need to send an email:
1960 To: submit@bugs.debian.org
1962 Subject: My problem with hkl...
1967 I found this problem in hkl...
1970 *** Providing patchs
1972 you can send your patch to [[picca@synchrotron-soleil.fr][Picca
1973 Frédéric-Emmanuel]] using =git=
1975 Here a minimalist exemple of the workflow to prepare and send a patch
1976 for hkl. Suppose you wan to add a new feature to hkl create first a new
1977 branch from the next one:
1980 $ git checkout -b my-next next
1995 now that your new feature is ready for a review, you can send by email
1996 your work using git format-patch:
1999 $ git format-patch origin/next
2002 and send generated files 0001\_xxx, 0002\_xxx, ... to the author.
2004 ** Howto add a diffractometer
2006 To add a new diffractometer, you just need to copy the
2007 hkl/hkl-engine-template.c into
2008 hkl/hkl-engine-INSTITUT-BEAMLINE-INSTRUMENT.c where you replace the
2009 upper case with the appropriate values.
2011 The template file is compiled during the build process to ensure that it
2014 Then you just need to follow the instruction found in the template. If
2015 you need some precision about the process, do not hesitate to contact
2018 do not forgot also to add this new file into hkl/Makefile.am with other
2019 diffractometers in the hkl\_c\_sources variable (please keep the
2023 The hkl library use the gobject-introspection to provide automatic
2024 binding for a few languages.
2030 has you can see there is 4 available solutions.
2032 let's compute an hkl trajectory and select the first solution.
2034 if we look at the 3 other solutions we can see that there is a problem
2035 of continuity at the begining of the trajectory.
2037 hey what's happend with theses solutions ! let's look closely to real
2038 numbers. the last column is the distance to the diffractometer current
2039 position. This distance is for now express like this:
2041 $$\sum_{axes} \left|\text{current position} - \text{target position}\right|$$
2044 [0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
2045 [0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
2046 [0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
2047 [0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
2049 [0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
2050 [0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
2051 [0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
2052 [0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
2054 [0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
2055 [0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
2056 [0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
2057 [0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
2059 [0.0, 114.39338605351007, 21.85448296702796, -97.074145033719, 0.0, 62.93506298693471] 0.218163667981
2060 [0.0, -128.54167683157993, 21.85448296702796, -97.07414574435087, 0.0, -62.93506298693471] 6.59846359365
2061 [0.0, -51.45832316842005, -21.85448296702796, 97.07414574435087, 0.0, 62.93506298693471] 6.93673746356
2062 [0.0, 65.60661394648993, -21.85448296702796, 97.074145033719, 0.0, -62.93506298693471] 7.03385205725
2064 [0.0, 113.28316795475283, 28.583837575232764, -99.29953499008337, 0.0, 65.16540747008955] 0.21459359225
2065 [0.0, -131.88223933078322, 28.583837575232764, -99.29953638594702, 0.0, -65.16540747008955] 6.69038531388
2066 [0.0, -48.11776066921677, -28.583837575232764, 99.29953638594702, 0.0, 65.16540747008955] 7.18296350386
2067 [0.0, 66.71683204524717, -28.583837575232764, 99.29953499008337, 0.0, -65.16540747008955] 7.37556986959
2069 [0.0, 112.56286877075006, 34.90573305321372, -101.42496979586187, 0.0, 67.97568017857415] 0.209053830457
2070 [0.0, -135.4128111996365, 34.90573305321372, -101.42497263302461, 0.0, -67.97568017857415] 6.81174779784
2071 [0.0, -44.58718880036348, -34.90573305321372, 101.4249726330246, 0.0, 67.97568017857415] 7.41581162393
2072 [0.0, 67.43713122924994, -34.90573305321372, 101.42496979586187, 0.0, -67.97568017857415] 7.7353201851
2074 [0.0, 112.2291126083182, 40.78594007247402, -103.43941832567457, 0.0, 71.33706722449408] 0.202280147961
2075 [0.0, -139.10795451001587, 40.78594007247402, -103.43942357602316, 0.0, -71.33706722449408] 6.96173845391
2076 [0.0, -40.89204548998411, -40.78594007247402, 103.43942357602312, 0.0, 71.33706722449408] 7.63358787543
2077 [0.0, 67.7708873916818, -40.78594007247402, 103.43941832567457, 0.0, -71.33706722449408] 8.10986069093
2079 [0.0, 112.27578927291766, 46.214916130901734, -105.33741042812996, 0.0, 75.22640762217479] 0.196576175748
2080 [0.0, -142.95061850160724, 46.214916130901734, -105.3374188005596, 0.0, -75.22640762217479] 7.13962155618
2081 [0.0, -37.04938149839278, -46.214916130901734, 105.33741880055959, 0.0, 75.22640762217479] 7.83557762281
2082 [0.0, 67.72421072708234, -46.214916130901734, 105.33741042812996, 0.0, -75.22640762217479] 8.49706672677
2084 [0.0, 112.697137434232, 51.201667684695856, -107.11797492933192, 0.0, 79.63023536264535] 0.202327153157
2085 [0.0, -146.9330984641471, 51.201667684695856, -107.11798610058318, 0.0, -79.63023536264535] 7.34491897177
2086 [0.0, -33.0669015358529, -51.201667684695856, 107.11798610058317, 0.0, 79.63023536264535] 8.02185610877
2087 [0.0, 67.30286256576798, -51.201667684695856, 107.11797492933192, 0.0, -79.63023536264535] 8.89597005568
2089 [0.0, 113.49085964586432, 55.76762791023837, -108.78347437395287, 0.0, 84.54867879242364] 0.208455586312
2090 [0.0, -151.05782007465257, 55.76762791023837, -108.78348605483542, 0.0, -84.54867879242364] 7.57761473366
2091 [0.0, -28.942179925347414, -55.76762791023837, 108.78348605483538, 0.0, 84.54867879242364] 8.19307323084
2092 [0.0, 66.50914035413568, -55.76762791023837, 108.78347437395287, 0.0, -84.54867879242364] 9.30675279514
2094 [0.0, 114.6614608037443, 59.941489465646214, -110.3385360479293, 0.0, 90.00000081324956] 0.215562935229
2095 [0.0, -155.33854118146962, 59.941489465646214, -110.33854432979601, 0.0, -89.99999918675044] 7.83839602383
2096 [0.0, -24.661458818530395, -59.941489465646214, 110.33854432979601, 0.0, 90.00000081324956] 8.3502621071
2097 [0.0, 65.3385391962557, -59.941489465646214, 110.3385360479293, 0.0, -89.99999918675044] 9.7307712883
2100 as you can see for the first point of the trajectory, the 2nd, 3rd and
2101 4th solutions have identical distances to the current position of the
2102 diffractometer so they are un-ordered:
2105 [0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
2106 [0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
2107 [0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
2108 [0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
2111 then the problem arise with the second and third solution. you can see a
2112 sort of reorganisation of the solution. 2 -> 3, 3 -> 4 and 4 -> 2 then
2113 the order will stick unchanged until the end of the trajectory. this is
2114 because the distance is computed relatively to the current position of
2115 the diffractometer.:
2118 [0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
2119 [0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
2120 [0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
2121 [0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
2123 [0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
2124 [0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
2125 [0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
2126 [0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
2132 when you compute a trajectory, start from a valid position (the
2133 starting point must be the real first point of your trajectory) then
2134 use only the closest solution for the next points of the trajectory.
2135 (first solution of the geometries list)