[contrib][haskell] PyFAI.Detector
[hkl.git] / hkl / hkl-engine-2c.c
blob2bbd01195e5e181add4c4ffd953518b631863f43
1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2017 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #include "hkl-macros-private.h"
23 #include "hkl-factory-private.h" // for autodata_factories_, etc
24 #include "hkl-pseudoaxis-private.h" // for hkl_engine_list_add, etc
25 #include "hkl/ccan/array_size/array_size.h"
27 #define OMEGA "omega"
28 #define TTH "tth"
30 #define HKL_GEOMETRY_TWOC_DESCRIPTION \
31 "+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
32 "+ 1 axes for the sample\n" \
33 "\n" \
34 " + **" OMEGA "** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
35 "\n" \
36 "+ 1 axis for the detector\n" \
37 "\n" \
38 " + **" TTH "** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
40 static const char* hkl_geometry_twoC_axes[] = {OMEGA, TTH};
42 static HklGeometry *hkl_geometry_new_twoC(const HklFactory *factory)
44 HklGeometry *self = hkl_geometry_new(factory, &hkl_geometry_operations_defaults);
45 HklHolder *h;
47 h = hkl_geometry_add_holder(self);
48 hkl_holder_add_rotation(h, OMEGA, 0, -1, 0, &hkl_unit_angle_deg);
50 h = hkl_geometry_add_holder(self);
51 hkl_holder_add_rotation(h, TTH, 0, -1, 0, &hkl_unit_angle_deg);
53 return self;
56 static HklEngineList *hkl_engine_list_new_twoC(const HklFactory *factory)
58 HklEngineList *self = hkl_engine_list_new();
60 return self;
63 REGISTER_DIFFRACTOMETER(twoC, "TwoC", HKL_GEOMETRY_TWOC_DESCRIPTION);