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
1e827aa8
Commit
1e827aa8
authored
10 years ago
by
Owen Arnold
Browse files
Options
Downloads
Patches
Plain Diff
refs #10693. Doctest and better docs
parent
726ebd85
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
Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py
+0
-1
0 additions, 1 deletion
...nInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py
Code/Mantid/docs/source/algorithms/CutMD-v1.rst
+68
-0
68 additions, 0 deletions
Code/Mantid/docs/source/algorithms/CutMD-v1.rst
with
68 additions
and
1 deletion
Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/CutMD.py
+
0
−
1
View file @
1e827aa8
...
@@ -196,7 +196,6 @@ class CutMD(DataProcessorAlgorithm):
...
@@ -196,7 +196,6 @@ class CutMD(DataProcessorAlgorithm):
def
__verify_projection_input
(
self
,
projection_table
):
def
__verify_projection_input
(
self
,
projection_table
):
if
isinstance
(
projection_table
,
ITableWorkspace
):
if
isinstance
(
projection_table
,
ITableWorkspace
):
column_names
=
set
(
projection_table
.
getColumnNames
())
column_names
=
set
(
projection_table
.
getColumnNames
())
logger
.
warning
(
str
(
column_names
))
if
not
column_names
==
set
([
Projection
.
u
,
Projection
.
v
,
'
type
'
]):
if
not
column_names
==
set
([
Projection
.
u
,
Projection
.
v
,
'
type
'
]):
if
not
column_names
==
set
([
Projection
.
u
,
Projection
.
v
,
'
offsets
'
,
'
type
'
]):
if
not
column_names
==
set
([
Projection
.
u
,
Projection
.
v
,
'
offsets
'
,
'
type
'
]):
if
not
column_names
==
set
([
Projection
.
u
,
Projection
.
v
,
Projection
.
w
,
'
offsets
'
,
'
type
'
]):
if
not
column_names
==
set
([
Projection
.
u
,
Projection
.
v
,
Projection
.
w
,
'
offsets
'
,
'
type
'
]):
...
...
This diff is collapsed.
Click to expand it.
Code/Mantid/docs/source/algorithms/CutMD-v1.rst
0 → 100644
+
68
−
0
View file @
1e827aa8
.. algorithm::
.. summary::
.. alias::
.. properties::
Description
-----------
This algorithm performs slicing of multiDimensional data according to a chosen projection, and binning choice. The algorithm uses :ref:`algm-BinMD` or
:ref:`algm-SliceMD` to achieve the binning of the data. The choice of child algorithm used for the slicing is controlled by the NoPix option.
The synax is similar to that used by `Horace <http://horace.isis.rl.ac.uk/Manipulating_and_extracting_data_from_SQW_files_and_objects#cut_sqw>`__.
Usage
-----
**Example - Contrived example using projections:**
.. testcode:: Example4D
to_cut = CreateMDWorkspace(Dimensions=4, Extents=[-1,1,-1,1,-1,1,-10,10], Names="H,K,L,E", Units="U,U,U,V")
# Add two fake peaks so that we can see the effect of the basis transformation
FakeMDEventData(InputWorkspace='to_cut', PeakParams=[10000,-0.5,0,0,0,0.1])
FakeMDEventData(InputWorkspace='to_cut', PeakParams=[10000,0.5,0,0,0,0.1])
SetUB(Workspace=to_cut, a=1, b=1, c=1, alpha=90, beta=90, gamma=90)
SetSpecialCoordinates(InputWorkspace=to_cut, SpecialCoordinates='HKL')
projection = CreateEmptyTableWorkspace()
# Correct number of columns, and names
projection.addColumn("double", "u")
projection.addColumn("double", "v")
projection.addColumn("double", "w")
projection.addColumn("double", "offsets")
projection.addColumn("str", "type")
projection.addRow([1,-1, 0, 0, "r"])
projection.addRow([1, 1, 0, 0, "r"])
projection.addRow([0, 0, 1, 0, "r"])
# Apply the cut
out_md = CutMD(to_cut, Projection=projection, P1Bin=[0.1], P2Bin=[0.1], P3Bin=[0.1], P4Bin=[-5,5], NoPix=True)
print 'number of dimensions', out_md.getNumDims()
print 'number of dimensions not integrated', len(out_md.getNonIntegratedDimensions())
dim_dE = out_md.getDimension(3)
print 'min dE', dim_dE.getMaximum()
print 'max dE', dim_dE.getMinimum()
Output:
.. testoutput:: Example4D
number of dimensions 4
number of dimensions not integrated 3
min dE 5.0
max dE -5.0
.. categories::
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