26 static const std::string ret(
"Q (lab frame)");
31 static const std::string ret(
"Q (sample frame)");
36 static const std::string ret(
"HKL");
70 "An input/output workspace. The new log will be added to it. Important "
71 "Note: This has now only an effect on PeaksWorkspaces. MDEvent and "
72 "MDHisto worksapces are not affaceted by this algorithm");
76 "What will be the dimensions of the output workspace?\n"
77 " Q (lab frame): Wave-vector change of the lattice in the lab frame.\n"
78 " Q (sample frame): Wave-vector change of the lattice in the frame of "
79 "the sample (taking out goniometer rotation).\n"
80 " HKL: Use the sample's UB matrix to convert to crystal's HKL indices.");
86 if (std::dynamic_pointer_cast<IMDEventWorkspace>(inWS)) {
87 g_log.
warning(
"SetSpecialCoordinates: This algorithm cannot set the "
88 "special coordinate system for an MDEvent workspace any "
98 if (std::dynamic_pointer_cast<IMDHistoWorkspace>(inWS)) {
99 g_log.
warning(
"SetSpecialCoordinates: This algorithm cannot set the "
100 "special coordinate system for an MDHisto workspace any "
109 bool written =
false;
110 if (
auto peaksWS = std::dynamic_pointer_cast<IPeaksWorkspace>(inWS)) {
111 peaksWS->setCoordinateSystem(coordinateSystem);
124 std::string requestedCoordinateSystem =
getProperty(
"SpecialCoordinates");
132 throw std::invalid_argument(
"A workspace of this type cannot be processed/");
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A property class for workspaces.
SpecialCoordinatesNameMap m_specialCoordinatesMap
std::vector< std::string > m_specialCoordinatesNames
bool writeCoordinatesToPeaksWorkspace(const Mantid::API::Workspace_sptr &inWS, Mantid::Kernel::SpecialCoordinateSystem coordinateSystem)
bool writeCoordinatesToMDEventWorkspace(const Mantid::API::Workspace_sptr &inWS, Mantid::Kernel::SpecialCoordinateSystem coordinateSystem)
bool writeCoordinatesToMDHistoWorkspace(const Mantid::API::Workspace_sptr &inWS, Mantid::Kernel::SpecialCoordinateSystem coordinateSystem)
void init() override
Initialize the algorithm's properties.
SetSpecialCoordinates()
Constructor.
static const std::string QLabOption()
static const std::string HKLOption()
static const std::string QSampleOption()
const std::string name() const override
Algorithm's name for identification.
void exec() override
Execute the algorithm.
int version() const override
Algorithm's version for identification.
const std::string category() const override
Algorithm's category for identification.
The Logger class is in charge of the publishing messages from the framework through various channels.
void warning(const std::string &msg)
Logs at warning level.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Kernel::Logger g_log("ExperimentInfo")
static logger object
SpecialCoordinateSystem
Special coordinate systems for Q3D.
@ InOut
Both an input & output workspace.