13#include <boost/python/class.hpp>
39void setUFromVectors(
OrientedLattice &self,
const object &vec1,
const object &vec2) {
54 using return_readonly_numpy = return_value_policy<Policies::MatrixRefToNumpy<Converters::WrapReadOnly>>;
56 class_<OrientedLattice, bases<UnitCell>>(
"OrientedLattice",
57 init<>(
"Default constructor, with "
58 ":math:`a=b=c=1 \\rm{\\AA}, \\alpha = \\beta = \\gamma = "
59 "90^\\circ`. The :math:`U` matrix is set to the identity matrix."))
60 .def(init<OrientedLattice const &>((arg(
"other")),
"Copy constructor for creating a new oriented lattice."))
61 .def(init<double, double, double>((arg(
"_a"), arg(
"_b"), arg(
"_c")),
62 "Constructor using :math:`a, b, c` (in :math:`\\rm{\\AA}`), "
63 ":math:`\\alpha=\\beta=\\gamma=90^\\circ`. The :math:`U` matrix is "
64 "set to the identity matrix."))
65 .def(init<
double,
double,
double,
double,
double,
double, optional<int>>(
66 (arg(
"_a"), arg(
"_b"), arg(
"_c"), arg(
"_alpha"), arg(
"_beta"), arg(
"_gamma"),
68 "Constructor using :math:`a, b, c` (in :math:`\\rm{\\AA}`), "
69 ":math:`\\alpha, \\beta, "
70 "\\gamma` (in degrees or radians). The optional parameter ``Unit`` "
72 "units for the angles, and can have the value of ``Degrees`` or "
73 "``Radians``. By default ``Unit`` = ``Degrees``."))
74 .def(init<UnitCell>(arg(
"uc"),
"Constructor from a :class:`~mantid.geometry.UnitCell`. "
75 "The :math:`U` matrix is set to the identity matrix."))
77 "Returns the vector along the beam direction when "
78 ":class:`~mantid.geometry.Goniometer` s are at 0. ")
80 "Returns the vector along the horizontal plane, perpendicular to "
81 "the beam direction when :class:`~mantid.geometry.Goniometer` s are "
84 "Returns the :math:`U` rotation matrix. This will return a "
85 ":class:`numpy.ndarray` with shape ``(3,3)``.")
86 .def(
"setU", &setU, (arg(
"self"), arg(
"newU"), arg(
"force") =
true),
87 "Set the :math:`U` rotation matrix. This method expects a "
88 ":class:`numpy.ndarray` with shape ``(3,3)``.")
90 "Returns the :math:`UB` matrix for this oriented lattice. This will "
92 "a :class:`numpy.ndarray` with shape ``(3,3)``.")
93 .def(
"setUB", &setUB, (arg(
"self"), arg(
"newUB")),
94 "Set the :math:`UB` matrix. This methiod will calculate first the "
95 "lattice parameters, then the :math:`B` matrix, and then :math:`U`. "
96 "This method expects a "
97 ":class:`numpy.ndarray` with shape ``(3,3)``. ")
99 "Returns the :math:`ModUB` matrix for this oriented lattice. This "
102 "a :class:`numpy.ndarray` with shape ``(3,3)``.")
103 .def(
"setModUB", &setModUB, (arg(
"self"), arg(
"newModUB")),
104 "Set the :math:`ModUB` matrix. This methiod will calculate first the "
105 "lattice parameters, then the :math:`B` matrix, and then :math:`U`. "
106 "This method expects a "
107 ":class:`numpy.ndarray` with shape ``(3,3)``. ")
108 .def(
"setUFromVectors", &setUFromVectors, (arg(
"self"), arg(
"u"), arg(
"v")),
109 "Set the :math:`U` rotation matrix using two vectors to define a "
111 "coordinate system. This method with return the new :math:`U` "
113 "as a :class:`numpy.ndarray` with shape ``(3,3)``. ")
114 .def(
"qFromHKL", &qFromHKL, (arg(
"self"), arg(
"vec")),
":math:`Q` vector from :math:`HKL` vector")
115 .def(
"hklFromQ", &hklFromQ, (arg(
"self"), arg(
"vec")),
":math:`HKL` value from :math:`Q` vector");
void export_OrientedLattice()
Class to implement UB matrix.
Kernel::V3D getuVector() const
gets a vector along beam direction when goniometers are at 0.
void setU(const Kernel::DblMatrix &newU, const bool force=true)
Sets the U matrix.
Kernel::V3D getvVector() const
gets a vector in the horizontal plane, perpendicular to the beam direction when goniometers are at 0.
void setModUB(const Kernel::DblMatrix &newModUB)
Sets the Modulation UB matrix.
Kernel::V3D hklFromQ(const Kernel::V3D &Q) const
Return hkl from the Q-sample coordinates.
void setUB(const Kernel::DblMatrix &newUB)
Sets the UB matrix and recalculates lattice parameters.
const Kernel::DblMatrix & setUFromVectors(const Kernel::V3D &u, const Kernel::V3D &v)
Create the U matrix from two vectors.
const Kernel::DblMatrix & getUB() const
Get the UB matrix.
Kernel::V3D qFromHKL(const Kernel::V3D &hkl) const
Return Q-sample coordinates from hkl.
const Kernel::DblMatrix & getModUB() const
const Kernel::DblMatrix & getU() const
Get the U matrix.
Class to implement unit cell of crystals.
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 ...