Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
a4b17d4f
Commit
a4b17d4f
authored
9 years ago
by
Anton Piccardo-Selg
Browse files
Options
Downloads
Patches
Plain Diff
Refs #13872 Fix SetSpecialCoordinate algorithm
parent
bdeb6f3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Crystal/src/SetSpecialCoordinates.cpp
+14
-3
14 additions, 3 deletions
Framework/Crystal/src/SetSpecialCoordinates.cpp
Framework/Crystal/test/SetSpecialCoordinatesTest.h
+8
-4
8 additions, 4 deletions
Framework/Crystal/test/SetSpecialCoordinatesTest.h
with
22 additions
and
7 deletions
Framework/Crystal/src/SetSpecialCoordinates.cpp
+
14
−
3
View file @
a4b17d4f
...
...
@@ -4,10 +4,15 @@
#include
"MantidAPI/IMDEventWorkspace.h"
#include
"MantidAPI/IMDHistoWorkspace.h"
#include
"MantidKernel/ListValidator.h"
#include
"MantidKernel/Logger.h"
using
namespace
Mantid
::
Kernel
;
using
namespace
Mantid
::
API
;
namespace
{
Mantid
::
Kernel
::
Logger
g_log
(
"SetSpecialCoordinates"
);
}
namespace
Mantid
{
namespace
Crystal
{
...
...
@@ -70,7 +75,9 @@ const std::string SetSpecialCoordinates::category() const { return "Crystal"; }
void
SetSpecialCoordinates
::
init
()
{
declareProperty
(
new
WorkspaceProperty
<
Workspace
>
(
"InputWorkspace"
,
""
,
Direction
::
InOut
),
"An input/output workspace. The new log will be added to it."
);
"An input/output workspace. The new log will be added to it. Improtant "
"Note: This has now only an effect on PeaksWorkspaces. MDEvent and "
"MDHisto worksapces are not affaceted by this algorithm"
);
declareProperty
(
"SpecialCoordinates"
,
"Q (lab frame)"
,
...
...
@@ -86,7 +93,9 @@ bool SetSpecialCoordinates::writeCoordinatesToMDEventWorkspace(
Workspace_sptr
inWS
,
SpecialCoordinateSystem
coordinateSystem
)
{
bool
written
=
false
;
if
(
auto
mdEventWS
=
boost
::
dynamic_pointer_cast
<
IMDEventWorkspace
>
(
inWS
))
{
mdEventWS
->
setCoordinateSystem
(
coordinateSystem
);
g_log
.
warning
(
"SetSpecialCoordinates: This algorithm cannot set the "
"special coordinate system for an MDEvent workspace any "
"longer."
);
written
=
true
;
}
return
written
;
...
...
@@ -96,7 +105,9 @@ bool SetSpecialCoordinates::writeCoordinatesToMDHistoWorkspace(
Workspace_sptr
inWS
,
SpecialCoordinateSystem
coordinateSystem
)
{
bool
written
=
false
;
if
(
auto
mdHistoWS
=
boost
::
dynamic_pointer_cast
<
IMDHistoWorkspace
>
(
inWS
))
{
mdHistoWS
->
setCoordinateSystem
(
coordinateSystem
);
g_log
.
warning
(
"SetSpecialCoordinates: This algorithm cannot set the "
"special coordinate system for an MDHisto workspace any "
"longer."
);
written
=
true
;
}
return
written
;
...
...
This diff is collapsed.
Click to expand it.
Framework/Crystal/test/SetSpecialCoordinatesTest.h
+
8
−
4
View file @
a4b17d4f
...
...
@@ -90,8 +90,10 @@ public:
auto
outWS
=
AnalysisDataService
::
Instance
().
retrieveWS
<
IMDWorkspace
>
(
"inWS"
);
TS_ASSERT_EQUALS
(
Mantid
::
Kernel
::
QSample
,
outWS
->
getSpecialCoordinateSystem
());
TSM_ASSERT_EQUALS
(
"Should still be still with the same special coordinate system"
,
inWS
->
getSpecialCoordinateSystem
(),
outWS
->
getSpecialCoordinateSystem
());
AnalysisDataService
::
Instance
().
remove
(
"inWS"
);
}
...
...
@@ -109,8 +111,10 @@ public:
auto
outWS
=
AnalysisDataService
::
Instance
().
retrieveWS
<
IMDWorkspace
>
(
"inWS"
);
TS_ASSERT_EQUALS
(
Mantid
::
Kernel
::
QSample
,
outWS
->
getSpecialCoordinateSystem
());
TSM_ASSERT_EQUALS
(
"Should still be still with the same special coordinate system"
,
inWS
->
getSpecialCoordinateSystem
(),
outWS
->
getSpecialCoordinateSystem
());
AnalysisDataService
::
Instance
().
remove
(
"inWS"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment