13#include <boost/python/class.hpp>
39void setUFromVectors(
OrientedLattice &self,
const object &vec1,
const object &vec2) {
58 using return_readonly_numpy = return_value_policy<Policies::MatrixRefToNumpy<Converters::WrapReadOnly>>;
60 class_<OrientedLattice, bases<UnitCell>>(
"OrientedLattice",
61 init<>(
"Default constructor, with "
62 ":math:`a=b=c=1 \\rm{\\AA}, \\alpha = \\beta = \\gamma = "
63 "90^\\circ`. The :math:`U` matrix is set to the identity matrix."))
64 .def(init<OrientedLattice const &>((arg(
"other")),
"Copy constructor for creating a new oriented lattice."))
65 .def(init<double, double, double>((arg(
"_a"), arg(
"_b"), arg(
"_c")),
66 "Constructor using :math:`a, b, c` (in :math:`\\rm{\\AA}`), "
67 ":math:`\\alpha=\\beta=\\gamma=90^\\circ`. The :math:`U` matrix is "
68 "set to the identity matrix."))
69 .def(init<
double,
double,
double,
double,
double,
double, optional<int>>(
70 (arg(
"_a"), arg(
"_b"), arg(
"_c"), arg(
"_alpha"), arg(
"_beta"), arg(
"_gamma"),
72 "Constructor using :math:`a, b, c` (in :math:`\\rm{\\AA}`), "
73 ":math:`\\alpha, \\beta, "
74 "\\gamma` (in degrees or radians). The optional parameter ``Unit`` "
76 "units for the angles, and can have the value of ``Degrees`` or "
77 "``Radians``. By default ``Unit`` = ``Degrees``."))
78 .def(init<UnitCell>(arg(
"uc"),
"Constructor from a :class:`~mantid.geometry.UnitCell`. "
79 "The :math:`U` matrix is set to the identity matrix."))
81 "Returns the vector along the beam direction when "
82 ":class:`~mantid.geometry.Goniometer` s are at 0. ")
84 "Returns the vector along the horizontal plane, perpendicular to "
85 "the beam direction when :class:`~mantid.geometry.Goniometer` s are "
88 "Returns the :math:`U` rotation matrix. This will return a "
89 ":class:`numpy.ndarray` with shape ``(3,3)``.")
90 .def(
"setU", &setU, (arg(
"self"), arg(
"newU"), arg(
"force") =
true),
91 "Set the :math:`U` rotation matrix. This method expects a "
92 ":class:`numpy.ndarray` with shape ``(3,3)``.")
94 "Returns the :math:`UB` matrix for this oriented lattice. This will "
96 "a :class:`numpy.ndarray` with shape ``(3,3)``.")
97 .def(
"setUB", &setUB, (arg(
"self"), arg(
"newUB")),
98 "Set the :math:`UB` matrix. This methiod will calculate first the "
99 "lattice parameters, then the :math:`B` matrix, and then :math:`U`. "
100 "This method expects a "
101 ":class:`numpy.ndarray` with shape ``(3,3)``. ")
103 "Returns the :math:`ModUB` matrix for this oriented lattice. This "
106 "a :class:`numpy.ndarray` with shape ``(3,3)``.")
107 .def(
"setModUB", &setModUB, (arg(
"self"), arg(
"newModUB")),
108 "Set the :math:`ModUB` matrix. This methiod will calculate first the "
109 "lattice parameters, then the :math:`B` matrix, and then :math:`U`. "
110 "This method expects a "
111 ":class:`numpy.ndarray` with shape ``(3,3)``. ")
112 .def(
"setUFromVectors", &setUFromVectors, (arg(
"self"), arg(
"u"), arg(
"v")),
113 "Set the :math:`U` rotation matrix using two vectors to define a "
115 "coordinate system. This method with return the new :math:`U` "
117 "as a :class:`numpy.ndarray` with shape ``(3,3)``. ")
118 .def(
"qFromHKL", &qFromHKL, (arg(
"self"), arg(
"vec")),
":math:`Q` vector from :math:`HKL` vector")
119 .def(
"hklFromQ", &hklFromQ, (arg(
"self"), arg(
"vec")),
":math:`HKL` value from :math:`Q` vector")
120 .def(
"cosFromDir", &cosFromDir, (arg(
"self"), arg(
"vec")),
"Direction cosine from direction vector");
std::vector< T > const * vec
void export_OrientedLattice()
Class to implement UB matrix.
Kernel::V3D cosFromDir(const Kernel::V3D &dir) const
Calculate the direction cosine corresponding to a given direction.
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
Calculate the hkl corresponding to a given Q-vector.
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)
Set the U rotation matrix, to provide the transformation, which translate an arbitrary vector V expre...
const Kernel::DblMatrix & getUB() const
Get the UB matrix.
Kernel::V3D qFromHKL(const Kernel::V3D &hkl) const
Calculate the hkl corresponding to a given Q-vector.
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 ...