19boost::optional<Mantid::Kernel::SpecialCoordinateSystem>
24 throw std::invalid_argument(
"Error in MDFrameFromWorkspace: Can only "
25 "extract MDFrame from MDEvent and MDHisto "
34 boost::optional<Mantid::Kernel::SpecialCoordinateSystem> qFrameType =
37 auto hasQFrame =
false;
38 auto isUnknown =
false;
39 for (
size_t dimIndex = 0; dimIndex <
workspace->getNumDims(); ++dimIndex) {
40 auto dimension =
workspace->getDimension(dimIndex);
41 auto &frame = dimension->getMDFrame();
46 if (frame.getMDUnit().isQUnit()) {
47 auto specialCoordinteSystem = frame.equivalientSpecialCoordinateSystem();
51 qFrameType = specialCoordinteSystem;
58 boost::optional<Mantid::Kernel::SpecialCoordinateSystem> output;
78 boost::optional<Mantid::Kernel::SpecialCoordinateSystem> qFrameType)
const {
80 if (specialCoordinateSystem != qFrameType.get()) {
81 throw std::invalid_argument(
"Error in MDFrameFromWorkspace: Coordinate "
82 "system in the different dimensions don't "
95 auto isUnknown =
false;
IPeaksWorkspace_sptr workspace
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
Abstract interface to MDHistoWorkspace, for use in exposing to Python.
Basic MD Workspace Abstract Class.
bool isUnknownFrame(const Mantid::Geometry::IMDDimension_const_sptr &dimension) const
boost::optional< Mantid::Kernel::SpecialCoordinateSystem > operator()(const Mantid::API::IMDWorkspace *workspace) const
Get the Special Coordinate System based on the MDFrame information.
void checkQCompatibility(Mantid::Kernel::SpecialCoordinateSystem specialCoordinateSystem, boost::optional< Mantid::Kernel::SpecialCoordinateSystem > qFrameType) const
Make sure that the QFrame types are the same.
UnknownFrame : Unknown MDFrame.
std::unique_ptr< MDFrame > MDFrame_uptr
std::shared_ptr< const IMDDimension > IMDDimension_const_sptr
Shared Pointer to const IMDDimension.
SpecialCoordinateSystem
Special coordinate systems for Q3D.