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
a4c5c9c4
Commit
a4c5c9c4
authored
9 years ago
by
Matt King
Browse files
Options
Downloads
Patches
Plain Diff
Added progress report to ConvertToReflectometryQ
Refs #13508
parent
07fadfc3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
+17
-1
17 additions, 1 deletion
Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
with
17 additions
and
1 deletion
Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
+
17
−
1
View file @
a4c5c9c4
...
@@ -353,40 +353,54 @@ void ConvertToReflectometryQ::exec() {
...
@@ -353,40 +353,54 @@ void ConvertToReflectometryQ::exec() {
TableWorkspace_sptr
vertexes
=
TableWorkspace_sptr
vertexes
=
boost
::
make_shared
<
Mantid
::
DataObjects
::
TableWorkspace
>
();
boost
::
make_shared
<
Mantid
::
DataObjects
::
TableWorkspace
>
();
Progress
transSelectionProg
(
this
,
0.0
,
0.1
,
2
);
if
(
outputAsMDWorkspace
)
{
if
(
outputAsMDWorkspace
)
{
transSelectionProg
.
report
(
"Choosing Transformation"
);
if
(
transMethod
==
centerTransform
())
{
if
(
transMethod
==
centerTransform
())
{
auto
outputMDWS
=
transform
->
executeMD
(
inputWs
,
bc
);
auto
outputMDWS
=
transform
->
executeMD
(
inputWs
,
bc
);
Progress
transPerformProg
(
this
,
0.1
,
0.7
,
5
);
transPerformProg
.
report
(
"Performed transformation"
);
// Copy ExperimentInfo (instrument, run, sample) to the output WS
// Copy ExperimentInfo (instrument, run, sample) to the output WS
ExperimentInfo_sptr
ei
(
inputWs
->
cloneExperimentInfo
());
ExperimentInfo_sptr
ei
(
inputWs
->
cloneExperimentInfo
());
outputMDWS
->
addExperimentInfo
(
ei
);
outputMDWS
->
addExperimentInfo
(
ei
);
outputWS
=
outputMDWS
;
outputWS
=
outputMDWS
;
}
else
if
(
transMethod
==
normPolyTransform
())
{
}
else
if
(
transMethod
==
normPolyTransform
())
{
Progress
transPerformProg
(
this
,
0.1
,
0.7
,
5
);
const
bool
dumpVertexes
=
this
->
getProperty
(
"DumpVertexes"
);
const
bool
dumpVertexes
=
this
->
getProperty
(
"DumpVertexes"
);
auto
vertexesTable
=
vertexes
;
auto
vertexesTable
=
vertexes
;
// perform the normalised polygon transformation
// perform the normalised polygon transformation
transPerformProg
.
report
(
"Performing Transformation"
);
auto
normPolyTrans
=
transform
->
executeNormPoly
(
auto
normPolyTrans
=
transform
->
executeNormPoly
(
inputWs
,
vertexesTable
,
dumpVertexes
,
outputDimensions
);
inputWs
,
vertexesTable
,
dumpVertexes
,
outputDimensions
);
// copy any experiment info from input workspace
// copy any experiment info from input workspace
normPolyTrans
->
copyExperimentInfoFrom
(
inputWs
.
get
());
normPolyTrans
->
copyExperimentInfoFrom
(
inputWs
.
get
());
// produce MDHistoWorkspace from normPolyTrans workspace.
// produce MDHistoWorkspace from normPolyTrans workspace.
Progress
outputToMDProg
(
this
,
0.7
,
0.75
,
10
);
auto
outputMDWS
=
transform
->
executeMDNormPoly
(
normPolyTrans
);
auto
outputMDWS
=
transform
->
executeMDNormPoly
(
normPolyTrans
);
ExperimentInfo_sptr
ei
(
normPolyTrans
->
cloneExperimentInfo
());
ExperimentInfo_sptr
ei
(
normPolyTrans
->
cloneExperimentInfo
());
outputMDWS
->
addExperimentInfo
(
ei
);
outputMDWS
->
addExperimentInfo
(
ei
);
outputWS
=
outputMDWS
;
outputWS
=
outputMDWS
;
outputToMDProg
.
report
(
"Successfully output to MD"
);
}
else
{
}
else
{
throw
std
::
runtime_error
(
"Unknown rebinning method: "
+
transMethod
);
throw
std
::
runtime_error
(
"Unknown rebinning method: "
+
transMethod
);
}
}
}
else
if
(
transMethod
==
normPolyTransform
())
{
}
else
if
(
transMethod
==
normPolyTransform
())
{
transSelectionProg
.
report
(
"Choosing Transformation"
);
Progress
transPerformProg
(
this
,
0.1
,
0.7
,
5
);
const
bool
dumpVertexes
=
this
->
getProperty
(
"DumpVertexes"
);
const
bool
dumpVertexes
=
this
->
getProperty
(
"DumpVertexes"
);
auto
vertexesTable
=
vertexes
;
auto
vertexesTable
=
vertexes
;
// perform the normalised polygon transformation
// perform the normalised polygon transformation
transPerformProg
.
report
(
"Performing Transformation"
);
auto
output2DWS
=
transform
->
executeNormPoly
(
auto
output2DWS
=
transform
->
executeNormPoly
(
inputWs
,
vertexesTable
,
dumpVertexes
,
outputDimensions
);
inputWs
,
vertexesTable
,
dumpVertexes
,
outputDimensions
);
// copy any experiment info from input workspace
// copy any experiment info from input workspace
output2DWS
->
copyExperimentInfoFrom
(
inputWs
.
get
());
output2DWS
->
copyExperimentInfoFrom
(
inputWs
.
get
());
outputWS
=
output2DWS
;
outputWS
=
output2DWS
;
transPerformProg
.
report
(
"Transformation Complete"
);
}
else
if
(
transMethod
==
centerTransform
())
{
}
else
if
(
transMethod
==
centerTransform
())
{
transSelectionProg
.
report
(
"Choosing Transformation"
);
Progress
transPerformProg
(
this
,
0.1
,
0.7
,
5
);
transPerformProg
.
report
(
"Performing Transformation"
);
auto
output2DWS
=
transform
->
execute
(
inputWs
);
auto
output2DWS
=
transform
->
execute
(
inputWs
);
output2DWS
->
copyExperimentInfoFrom
(
inputWs
.
get
());
output2DWS
->
copyExperimentInfoFrom
(
inputWs
.
get
());
outputWS
=
output2DWS
;
outputWS
=
output2DWS
;
...
@@ -397,6 +411,8 @@ void ConvertToReflectometryQ::exec() {
...
@@ -397,6 +411,8 @@ void ConvertToReflectometryQ::exec() {
// Execute the transform and bind to the output.
// Execute the transform and bind to the output.
setProperty
(
"OutputWorkspace"
,
outputWS
);
setProperty
(
"OutputWorkspace"
,
outputWS
);
setProperty
(
"OutputVertexes"
,
vertexes
);
setProperty
(
"OutputVertexes"
,
vertexes
);
Progress
setPropertyProg
(
this
,
0.8
,
1.0
,
2
);
setPropertyProg
.
report
(
"Success"
);
}
}
}
// namespace Mantid
}
// namespace Mantid
...
...
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