14#include <boost/python/class.hpp>
15#include <boost/python/dict.hpp>
16#include <boost/python/make_constructor.hpp>
26 const bool ignoreMaskedDetectors,
27 const int nNeighbours = 8) {
34boost::python::dict mapToDict(
const std::map<Mantid::specnum_t, Mantid::Kernel::V3D> &inputMap) {
35 boost::python::dict result;
36 for (
const auto &pair : inputMap) {
37 result[pair.first] = pair.second;
45 return mapToDict(result);
51 return mapToDict(result);
56 return mapToDict(result);
62 class_<WorkspaceNearestNeighbourInfo, boost::noncopyable>(
"WorkspaceNearestNeighbourInfo", no_init)
63 .def(
"__init__", make_constructor(&createWorkspaceNearestNeighbourInfo, default_call_policies(),
64 (arg(
"workspace"), arg(
"ignoreMaskedDetectors"), arg(
"nNeighbours") = 8)))
65 .def(
"getNeighbours", &getNeighboursByDetector, (arg(
"self"), arg(
"comp"), arg(
"radius") = 0.0))
66 .def(
"getNeighbours", &getNeighboursBySpec, (arg(
"self"), arg(
"spec_num"), arg(
"radius")))
67 .def(
"getNeighboursExact", &getNeighboursExact, (arg(
"self"), arg(
"spec_num")));
#define GET_POINTER_SPECIALIZATION(TYPE)
IPeaksWorkspace_sptr workspace
void export_WorkspaceNearestNeighbourInfo()
WorkspaceNearestNeighbourInfo provides easy access to nearest-neighbour information for a workspace.
std::map< specnum_t, Kernel::V3D > getNeighbours(const Geometry::IDetector *comp, const double radius=0.0) const
Queries the WorkspaceNearestNeighbours object for the selected detector.
std::map< specnum_t, Kernel::V3D > getNeighboursExact(specnum_t spec) const
Queries the WorkspaceNearestNeighbours object for the selected spectrum number.
Interface class for detector objects.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
int32_t specnum_t
Typedef for a spectrum Number.