At P07 the two-theta angle corresponds to a translation and 3 rotations. A special Tango server has been created to server this purpose.
<device> <name>tth</name> <type>type_tango</type> <module>motor_tango</module> <device>p07/twotheta/eh2a.01</device> <control>tango</control> <hostname>hasgksspp07eh2a:10000</hostname> </device>
Here is the list of the attributes:
We have the following relations for a requested tth value at a specific energy:
#define LAMBDA_TO_E 12398.424 #define RAD_TO_DEGREE 57.295780 xdt AxisTranslationDetector rdt AxisRotationDetector rcoll AxisRotationCollimator oman AxisRotationAnalyzer l AxisDistanceSampleDetector --- setting a new tth theta_ana = RAD_TO_DEGREE* asin( 12398.424/E/2/d) E [eV] d [Angstr.] if FlagUseAnalyzer rdt = tth + 2*theta_ana rcoll = -2*theta_ana oman = theta_ana xdt = -l*tan( tth/RAD_TO_DEGREE) else rdt = tth rcoll = 0 oman = 0 xdt = -l*tan( tth/RAD_TO_DEGREE) --- reading tth tth = RAD_TO_DEGREE * atan( -xdt/l);
Note that there is a beamline-specific-code widget for the device which is described in the Online -tki manual.