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
86d4e544
Commit
86d4e544
authored
12 years ago
by
Michael Reuter
Browse files
Options
Downloads
Patches
Plain Diff
Refs #6119. Adding code to DgsReduction for powder conversion.
parent
8d6b996b
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
Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
+63
-0
63 additions, 0 deletions
.../Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
with
63 additions
and
0 deletions
Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
+
63
−
0
View file @
86d4e544
...
...
@@ -419,6 +419,33 @@ namespace Mantid
this
->
setPropertyGroup
(
"AbsUnitsMedianTestLow"
,
absUnitsCorr
);
this
->
setPropertyGroup
(
"AbsUnitsErrorBarCriterion"
,
absUnitsCorr
);
// Powder data conversion
std
::
string
powder
=
"Powder Data Conversion"
;
this
->
declareProperty
(
"DoPowderDataConversion"
,
false
,
"Flag to switch on converting DeltaE to SQW."
);
this
->
declareProperty
(
new
ArrayProperty
<
double
>
(
"PowderMomTransferRange"
,
boost
::
make_shared
<
RebinParamsValidator
>
(
true
)),
"A comma separated list of first bin boundary, width, last bin boundary.
\n
"
"Negative width value indicates logarithmic binning."
);
this
->
setPropertySettings
(
"PowderMomTransferRange"
,
new
VisibleWhenProperty
(
"DoPowderDataConversion"
,
IS_EQUAL_TO
,
"1"
));
this
->
declareProperty
(
"SavePowderNexusFile"
,
true
,
"Flag to use to save a processed NeXus file for powder data."
);
this
->
setPropertySettings
(
"SavePowderNexusFile"
,
new
VisibleWhenProperty
(
"DoPowderDataConversion"
,
IS_EQUAL_TO
,
"1"
));
this
->
declareProperty
(
new
FileProperty
(
"SavePowderNexusFilename"
,
""
,
FileProperty
::
OptionalSave
,
".nxs"
),
"Provide a filename for saving the processed powder data."
);
this
->
setPropertySettings
(
"SavePowderNexusFilename"
,
new
VisibleWhenProperty
(
"DoPowderDataConversion"
,
IS_EQUAL_TO
,
"1"
));
this
->
setPropertyGroup
(
"DoPowderDataConversion"
,
powder
);
this
->
setPropertyGroup
(
"PowderMomTransferRange"
,
powder
);
this
->
setPropertyGroup
(
"SavePowderNexusFile"
,
powder
);
this
->
setPropertyGroup
(
"SavePowderNexusFilename"
,
powder
);
// Common to PD and SC
this
->
declareProperty
(
new
WorkspaceProperty
<>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
),
"Provide a name for the output workspace."
);
this
->
declareProperty
(
"ReductionProperties"
,
"__dgs_reduction_properties"
,
...
...
@@ -797,6 +824,42 @@ namespace Mantid
}
}
// Convert from DeltaE to powder S(Q,W)
const
bool
doPowderConvert
=
this
->
getProperty
(
"DoPowderDataConversion"
);
if
(
doPowderConvert
)
{
// Collect information
std
::
string
sqwWsName
=
outputWsName
+
"_pd_sqw"
;
std
::
vector
<
double
>
qBinning
=
this
->
getProperty
(
"PowderMomTransferRange"
);
const
double
initialEnergy
=
boost
::
lexical_cast
<
double
>
(
outputWS
->
run
().
getProperty
(
"Ei"
)
->
value
());
IAlgorithm_sptr
sofqw
=
this
->
createSubAlgorithm
(
"SofQW3"
);
sofqw
->
setProperty
(
"InputWorkspace"
,
outputWS
);
sofqw
->
setProperty
(
"OutputWorkspace"
,
sqwWsName
);
sofqw
->
setProperty
(
"QAxisBinning"
,
qBinning
);
sofqw
->
setProperty
(
"EMode"
,
"Direct"
);
sofqw
->
setProperty
(
"EFixed"
,
initialEnergy
);
sofqw
->
executeAsSubAlg
();
MatrixWorkspace_sptr
sqwWS
=
sofqw
->
getProperty
(
"OutputWorkspace"
);
this
->
declareProperty
(
new
WorkspaceProperty
<>
(
"PowderSqwWorkspace"
,
sqwWsName
,
Direction
::
Output
));
this
->
setProperty
(
"PowderSqwWorkspace"
,
sqwWS
);
const
bool
saveProcNexus
=
this
->
getProperty
(
"SavePowderNexusFile"
);
if
(
saveProcNexus
)
{
std
::
string
saveProcNexusFilename
=
this
->
getProperty
(
"SavePowderNexusFilename"
);
if
(
saveProcNexusFilename
.
empty
())
{
saveProcNexusFilename
=
sqwWsName
+
".nxs"
;
}
IAlgorithm_sptr
saveNxs
=
this
->
createSubAlgorithm
(
"SaveNexus"
);
saveNxs
->
setProperty
(
"InputWorkspace"
,
sqwWS
);
saveNxs
->
setProperty
(
"Filename"
,
saveProcNexusFilename
);
saveNxs
->
executeAsSubAlg
();
}
}
this
->
setProperty
(
"OutputWorkspace"
,
outputWS
);
}
...
...
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