9#include <boost/python/class.hpp>
10#include <boost/python/enum.hpp>
11#include <boost/python/list.hpp>
19boost::python::list getListFromV3DVector(
const std::vector<V3D> &hkls) {
20 boost::python::list hklList;
21 for (
const auto &hkl : hkls) {
27boost::python::list getHKLsDefaultFilter(
const ReflectionGenerator &self,
double dMin,
double dMax) {
28 return getListFromV3DVector(self.
getHKLs(dMin, dMax));
31boost::python::list getHKLsUsingFilter(
const ReflectionGenerator &self,
double dMin,
double dMax,
36boost::python::list getUniqueHKLsDefaultFilter(
const ReflectionGenerator &self,
double dMin,
double dMax) {
40boost::python::list getUniqueHKLsUsingFilter(
ReflectionGenerator &self,
double dMin,
double dMax,
45std::vector<double> getDValues(
const ReflectionGenerator &self,
const boost::python::object &hkls) {
51std::vector<double> getFsSquared(
const ReflectionGenerator &self,
const boost::python::object &hkls) {
59 enum_<ReflectionConditionFilter>(
"ReflectionConditionFilter")
60 .value(
"None", ReflectionConditionFilter::None)
61 .value(
"Centering", ReflectionConditionFilter::Centering)
62 .value(
"SpaceGroup", ReflectionConditionFilter::SpaceGroup)
63 .value(
"StructureFactor", ReflectionConditionFilter::StructureFactor)
66 class_<ReflectionGenerator>(
"ReflectionGenerator", no_init)
68 (arg(
"crystalStructure"), arg(
"defaultFilter"))))
69 .def(
"getHKLs", &getHKLsDefaultFilter, (arg(
"self"), arg(
"dMin"), arg(
"dmax")))
70 .def(
"getHKLsUsingFilter", &getHKLsUsingFilter, (arg(
"self"), arg(
"dMin"), arg(
"dmax"), arg(
"filter")))
71 .def(
"getUniqueHKLs", &getUniqueHKLsDefaultFilter, (arg(
"self"), arg(
"dMin"), arg(
"dmax")))
72 .def(
"getUniqueHKLsUsingFilter", &getUniqueHKLsUsingFilter,
73 (arg(
"self"), arg(
"dMin"), arg(
"dmax"), arg(
"filter")))
74 .def(
"getDValues", &getDValues, (arg(
"self"), arg(
"hkls")))
75 .def(
"getFsSquared", &getFsSquared, (arg(
"self"), arg(
"hkls")));
void export_ReflectionGenerator()
Three components are required to describe a crystal structure:
std::vector< Kernel::V3D > getHKLs(double dMin, double dMax) const
Returns a list of HKLs within the specified d-limits using the default reflection condition filter.
HKLFilter_const_sptr getReflectionConditionFilter(ReflectionConditionFilter filter) const
Returns a reflection condition HKLFilter based on the supplied enum.
std::vector< double > getFsSquared(const std::vector< Kernel::V3D > &hkls) const
Returns a list of squared structure factor amplitudes corresponding to the supplied list of HKLs.
std::vector< Kernel::V3D > getUniqueHKLs(double dMin, double dMax) const
Returns a list of symetrically independent HKLs within the specified d-limits using the default refle...
std::vector< double > getDValues(const std::vector< Kernel::V3D > &hkls) const
Returns a list of d-values that correspond to the supplied hkl list, using the unit cell of the store...
ReflectionConditionFilter
Converts a Python sequence type to a C++ std::vector, where the element type is defined by the templa...