14#include <boost/python/class.hpp>
15#include <boost/python/dict.hpp>
16#include <boost/python/overloads.hpp>
32BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(getEulerAngles_overloads,
Goniometer::getEulerAngles, 0, 1)
41void calcFromQSampleAndWavelength(
Goniometer &self,
const object &
position,
double wavelength,
bool flip_x,
46boost::python::dict getAxis(
const Goniometer &self,
size_t axisnumber) {
47 const auto &axis = self.
getAxis(axisnumber);
49 boost::python::dict pythonAxis;
51 pythonAxis[
"angle"] = axis.
angle;
52 pythonAxis[
"sense"] = axis.sense;
61 using return_readonly_numpy = return_value_policy<Policies::MatrixRefToNumpy<Converters::WrapReadOnly>>;
63 class_<Goniometer>(
"Goniometer", init<>(arg(
"self")))
64 .def(init<Goniometer const &>((arg(
"self"), arg(
"other"))))
65 .def(init<DblMatrix>((arg(
"self"), arg(
"rot"))))
67 getEulerAngles_overloads(args(
"self",
"convention"),
"Default convention is \'YZX\'. Universal "
68 "goniometer is \'YZY\'"))
70 .def(
"setR", &setR, (arg(
"self"), arg(
"rot")))
72 .def(
"getAxis", &getAxis, (arg(
"self"), arg(
"axisnumber")))
73 .def(
"calcFromQSampleAndWavelength", &calcFromQSampleAndWavelength,
74 (arg(
"self"), arg(
"positions"), arg(
"wavelength"), arg(
"flip_x") =
false, arg(
"inner") =
false))
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
Class to represent a particular goniometer setting, which is described by the rotation matrix.
size_t getNumberAxes() const
std::vector< double > getEulerAngles(const std::string &convention="YZX")
Return Euler angles acording to a convention.
std::string getConventionFromMotorAxes() const
return the goniometer convention used determine from the motor axes
const Kernel::DblMatrix & getR() const
Return global rotation matrix.
void calcFromQSampleAndWavelength(const Mantid::Kernel::V3D &Q, double wavelength, bool flip_x=false, bool inner=false)
Calculate goniometer for rotation around y-asix for constant wavelength from Q Sample.
const GoniometerAxis & getAxis(size_t axisnumber) const
Get GoniometerAxis obfject using motor number.
double angle(const V3D &) const
Angle between this and another vector.
Kernel::V3D rotationaxis
GoniometerAxis name.
Takes a Python object and if it supports indexing and is two dimensional it attempts to convert it to...
Takes a Python object and if it supports indexing and is of length 3 then it will attempt to convert ...