|
1 | 1 | /***************************************************************************** |
2 | | - * |
3 | | - * pyobjcryst |
4 | | - * |
5 | | - * File coded by: Vincent Favre-Nicolin |
6 | | - * |
7 | | - * See AUTHORS.txt for a list of people who contributed. |
8 | | - * See LICENSE.txt for license information. |
9 | | - * |
10 | | - ****************************************************************************** |
11 | | - * |
12 | | - * boost::python bindings to ObjCryst::PowderPatternDiffraction. |
13 | | - * |
14 | | - * Changes from ObjCryst::PowderPatternDiffraction |
15 | | - * |
16 | | - * Other Changes |
17 | | - * |
18 | | - *****************************************************************************/ |
| 2 | +* |
| 3 | +* pyobjcryst |
| 4 | +* |
| 5 | +* File coded by: Vincent Favre-Nicolin |
| 6 | +* |
| 7 | +* See AUTHORS.txt for a list of people who contributed. |
| 8 | +* See LICENSE.txt for license information. |
| 9 | +* |
| 10 | +****************************************************************************** |
| 11 | +* |
| 12 | +* boost::python bindings to ObjCryst::PowderPatternDiffraction. |
| 13 | +* |
| 14 | +* Changes from ObjCryst::PowderPatternDiffraction |
| 15 | +* |
| 16 | +* Other Changes |
| 17 | +* |
| 18 | +*****************************************************************************/ |
19 | 19 |
|
20 | 20 | #include <boost/python/enum.hpp> |
21 | 21 | #include <boost/python/class.hpp> |
|
25 | 25 |
|
26 | 26 | #include <ObjCryst/ObjCryst/General.h> |
27 | 27 | #include <ObjCryst/ObjCryst/PowderPattern.h> |
28 | | -#include <ObjCryst/ObjCryst/ScatteringData.h> |
| 28 | +#include <ObjCryst/ObjCryst/ScatteringData.h> |
29 | 29 |
|
30 | 30 | namespace bp = boost::python; |
31 | 31 | using namespace boost::python; |
32 | 32 | using namespace ObjCryst; |
33 | 33 |
|
| 34 | + |
34 | 35 | void wrap_powderpatterndiffraction() |
35 | 36 | { |
36 | | - enum_<ReflectionProfileType>("ReflectionProfileType") |
37 | | - .value("PROFILE_GAUSSIAN", PROFILE_GAUSSIAN) |
38 | | - .value("PROFILE_LORENTZIAN", PROFILE_LORENTZIAN) |
39 | | - .value("PROFILE_PSEUDO_VOIGT", PROFILE_PSEUDO_VOIGT) |
40 | | - .value("PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT", |
41 | | - PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT) |
42 | | - .value("PROFILE_PEARSON_VII", PROFILE_PEARSON_VII); |
| 37 | + enum_<ReflectionProfileType>("ReflectionProfileType") |
| 38 | + .value("PROFILE_GAUSSIAN", PROFILE_GAUSSIAN) |
| 39 | + .value("PROFILE_LORENTZIAN", PROFILE_LORENTZIAN) |
| 40 | + .value("PROFILE_PSEUDO_VOIGT", PROFILE_PSEUDO_VOIGT) |
| 41 | + .value("PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT", |
| 42 | + PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT) |
| 43 | + .value("PROFILE_PEARSON_VII", PROFILE_PEARSON_VII) |
| 44 | + ; |
43 | 45 |
|
44 | | - class_<PowderPatternDiffraction, |
45 | | - bases<PowderPatternComponent, ScatteringData>>( |
46 | | - "PowderPatternDiffraction", no_init) |
47 | | - .def("GetPowderPatternCalc", |
48 | | - &PowderPatternDiffraction::GetPowderPatternCalc, |
49 | | - return_value_policy<copy_const_reference>()) |
50 | | - .def("SetReflectionProfilePar", |
51 | | - &PowderPatternDiffraction::SetReflectionProfilePar, |
52 | | - (bp::arg("type") = PROFILE_PSEUDO_VOIGT, |
53 | | - bp::arg("fwhmCagliotiW") = 1e-6, |
54 | | - bp::arg("fwhmCagliotiU") = 0, |
55 | | - bp::arg("fwhmCagliotiV") = 0, |
56 | | - bp::arg("eta0") = 0.5, bp::arg("eta1") = 0)) |
57 | | - .def("GetProfile", |
58 | | - (ReflectionProfile & (PowderPatternDiffraction::*)()) & PowderPatternDiffraction::GetProfile, |
59 | | - return_internal_reference<>()) |
60 | | - .def("SetExtractionMode", |
61 | | - &PowderPatternDiffraction::SetExtractionMode, |
62 | | - (bp::arg("extract") = true, bp::arg("init") = false)) |
63 | | - .def("GetExtractionMode", |
64 | | - &PowderPatternDiffraction::GetExtractionMode) |
65 | | - .def("ExtractLeBail", |
66 | | - &PowderPatternDiffraction::ExtractLeBail, |
67 | | - (bp::arg("nbcycle") = 1)) |
68 | | - .def("SetCrystal", |
69 | | - &PowderPatternDiffraction::SetCrystal, |
70 | | - bp::arg("crystal"), |
71 | | - with_custodian_and_ward<1, 2>()) |
72 | | - .def("GetNbReflBelowMaxSinThetaOvLambda", |
73 | | - &PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda) |
74 | | - .def("GetFhklObsSq", &PowderPatternDiffraction::GetFhklObsSq, |
75 | | - return_value_policy<copy_const_reference>()); |
| 46 | + class_<PowderPatternDiffraction, |
| 47 | + bases<PowderPatternComponent, ScatteringData> >( |
| 48 | + "PowderPatternDiffraction", no_init) |
| 49 | + .def("GetPowderPatternCalc", |
| 50 | + &PowderPatternDiffraction::GetPowderPatternCalc, |
| 51 | + return_value_policy<copy_const_reference>()) |
| 52 | + .def("SetReflectionProfilePar", |
| 53 | + &PowderPatternDiffraction::SetReflectionProfilePar, |
| 54 | + (bp::arg("type")=PROFILE_PSEUDO_VOIGT, |
| 55 | + bp::arg("fwhmCagliotiW")=1e-6, |
| 56 | + bp::arg("fwhmCagliotiU")=0, |
| 57 | + bp::arg("fwhmCagliotiV")=0, |
| 58 | + bp::arg("eta0")=0.5, bp::arg("eta1")=0)) |
| 59 | + .def("GetProfile", |
| 60 | + (ReflectionProfile& (PowderPatternDiffraction::*)()) |
| 61 | + &PowderPatternDiffraction::GetProfile, |
| 62 | + return_internal_reference<>()) |
| 63 | + .def("SetExtractionMode", |
| 64 | + &PowderPatternDiffraction::SetExtractionMode, |
| 65 | + (bp::arg("extract")=true, bp::arg("init")=false)) |
| 66 | + .def("GetExtractionMode", |
| 67 | + &PowderPatternDiffraction::GetExtractionMode) |
| 68 | + .def("ExtractLeBail", |
| 69 | + &PowderPatternDiffraction::ExtractLeBail, |
| 70 | + (bp::arg("nbcycle")=1)) |
| 71 | + .def("SetCrystal", |
| 72 | + &PowderPatternDiffraction::SetCrystal, |
| 73 | + bp::arg("crystal"), |
| 74 | + with_custodian_and_ward<1, 2>()) |
| 75 | + .def("GetNbReflBelowMaxSinThetaOvLambda", |
| 76 | + &PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda) |
| 77 | + .def("GetFhklObsSq", &PowderPatternDiffraction::GetFhklObsSq, |
| 78 | + return_value_policy<copy_const_reference>()) |
| 79 | + ; |
76 | 80 | } |
0 commit comments