11#include <boost/python/class.hpp>
12#include <boost/python/copy_const_reference.hpp>
13#include <boost/python/list.hpp>
14#include <boost/python/return_value_policy.hpp>
30boost::python::list getNonIntegratedDimensionsAsPyList(
const MDGeometry &self) {
33 boost::python::list nonIntegrated;
34 for (
auto &dimension : dimensions) {
35 nonIntegrated.append(std::const_pointer_cast<Mantid::Geometry::IMDDimension>(dimension));
42 class_<MDGeometry, boost::noncopyable>(
"MDGeometry", no_init)
45 "Returns the number of non-integrated dimensions present")
47 return_value_policy<RemoveConstSharedPtr>(),
48 "Returns the description of the :class:`~mantid.api.IMDDimension` "
50 "(starts from 0). Raises RuntimeError if index is out of range.")
53 return_value_policy<RemoveConstSharedPtr>(),
54 "Returns the description of the :class:`~mantid.api.IMDDimension` "
55 "with the given id string. "
56 "Raises ValueError if the string is not a known id.")
59 "Returns the index of the dimension with the given "
60 "name. Raises RuntimeError if the name does not "
64 "Returns the index of the :class:`~mantid.api.IMDDimension` with "
66 "ID. Raises RuntimeError if the name does not exist.")
68 .def(
"getNonIntegratedDimensions", &getNonIntegratedDimensionsAsPyList, arg(
"self"),
69 "Returns the description objects of the non-integrated dimension as "
70 "a python list of :class:`~mantid.api.IMDDimension`.")
73 "Returns a numpy array containing the width of the smallest bin in "
77 "Returns the :class:`~mantid.api.IMDDimension` description mapped "
81 "Returns the :class:`~mantid.api.IMDDimension` description mapped "
85 "Returns the :class:`~mantid.api.IMDDimension` description mapped "
89 "Returns the :class:`~mantid.api.IMDDimension` description mapped "
93 "Returns an XML representation, as a string, of the geometry of the "
97 (arg(
"self"), arg(
"index")), return_value_policy<copy_const_reference>(),
98 "Returns a :class:`~mantid.kernel.VMD` object defining the basis "
99 "vector for the specified "
103 "Clear any attached original workspaces")
106 "Returns True if there is a source workspace at the given index")
109 "Returns the number of source workspaces attached")
112 "Returns the source workspace attached at the given index")
115 return_value_policy<copy_const_reference>(),
116 "Returns the vector of the origin (in the original workspace) that "
117 "corresponds to 0,0,0... in this workspace")
120 "Returns the number of transformations from original workspace "
121 "coordinate systems")
124 "Returns the number of transformations to original workspace "
125 "coordinate systems")
Describes the geometry (i.e.
Mantid::Kernel::VMD & getOrigin()
std::shared_ptr< const Mantid::Geometry::IMDDimension > getTDimension() const
Get the t-dimension mapping.
size_t getNumberTransformsToOriginal() const
Get the number of transforms defined to the original coordinate system.
virtual std::shared_ptr< const Mantid::Geometry::IMDDimension > getDimension(size_t index) const
Get a dimension.
std::vector< std::shared_ptr< const Geometry::IMDDimension > > getNonIntegratedDimensions() const
Get non-collapsed dimensions.
size_t getDimensionIndexById(const std::string &id) const
Get the index of the dimension that matches the ID given.
virtual std::shared_ptr< const Mantid::Geometry::IMDDimension > getDimensionWithId(std::string id) const
Get a dimension.
size_t numOriginalWorkspaces() const
virtual size_t getNumDims() const
void clearOriginalWorkspaces()
Clear original workspaces.
bool hasOriginalWorkspace(size_t index=0) const
virtual std::vector< coord_t > estimateResolution() const
std::string getGeometryXML() const
std::shared_ptr< Workspace > getOriginalWorkspace(size_t index=0) const
Get the "original" workspace (the workspace that was the source for a binned MDWorkspace).
Mantid::Kernel::VMD & getBasisVector(size_t index)
Get the basis vector (in the original workspace) for a dimension of this workspace.
size_t getDimensionIndexByName(const std::string &name) const
Get the index of the dimension that matches the name given.
std::shared_ptr< const Mantid::Geometry::IMDDimension > getXDimension() const
Get the x-dimension mapping.
size_t getNumberTransformsFromOriginal() const
Get the number of transforms defined from the original coordinate system.
std::shared_ptr< const Mantid::Geometry::IMDDimension > getYDimension() const
Get the y-dimension mapping.
std::shared_ptr< const Mantid::Geometry::IMDDimension > getZDimension() const
Get the z-dimension mapping.
Implements the RemoveConstSharedPtr policy.
Implements a return value policy that returns a numpy array from a function returning a std::vector b...