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
cab0a26d
Commit
cab0a26d
authored
10 years ago
by
Roman Tolchenov
Browse files
Options
Downloads
Patches
Plain Diff
Re #9579. Forgot to change an example.
parent
d21cb837
Branches
23320_new_MDNorm
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/docs/source/algorithms/GroupDetectors-v2.rst
+38
-7
38 additions, 7 deletions
Code/Mantid/docs/source/algorithms/GroupDetectors-v2.rst
with
38 additions
and
7 deletions
Code/Mantid/docs/source/algorithms/GroupDetectors-v2.rst
+
38
−
7
View file @
cab0a26d
...
...
@@ -108,8 +108,6 @@ for version 1 here. <GroupDetectors-v1.html>`_
Usage
-----
.. include:: ../usagedata-note.txt
Example 1: specifying a map file
################################
...
...
@@ -148,7 +146,7 @@ Example 1: specifying a map file
# Create a workspace filled with a constant value = 0.3
ws=CreateSampleWorkspace()
# Group detecto
t
s according to the created file.
# Group detecto
r
s according to the created file.
grouped = GroupDetectors( ws, MapFile = groupingFilePath )
# Check the result
...
...
@@ -287,12 +285,41 @@ Example 5: keeping ungrouped spectra
.. testcode:: ExKeep
import os
# Create a grouping file from the example above.
# It makes 2 groups of 64 and 60 detectors respectively.
groupingFileContent = \
"""
2
1
64
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64
2
60
65 66 67 68 69 70 71 72 73 74
75 76 77 78 79 80 81 82 83 84
85 86 87 88 89 90 91 92 93 94
95 96 97 98 99 100 101 102 103 104
105 106 107 108 109 110 111 112 113 114
115 116 117 118 119 120 121 122 123 124
"""
# Save the data to a file
groupingFilePath = os.path.expanduser('~/MantidUsageExample_GroupDetectorsGrouping.txt')
f = open(groupingFilePath, 'w')
f.write( groupingFileContent )
f.close()
# Create a workspace filled with a constant value = 0.3
ws=CreateSampleWorkspace()
# Group detectots according to GroupDetectorsGrouping.txt from UsageData.
# The file is a copy of the example above. It makes 2 groups of 64 and 60 detectors respectively.
grouped = GroupDetectors(ws,MapFile='GroupDetectorsGrouping.txt',KeepUngroupedSpectra=True)
# Group detectors according to the created file.
grouped = GroupDetectors( ws, MapFile=groupingFilePath, KeepUngroupedSpectra=True )
# Check the result
print 'Number of spectra in grouped workspace is', grouped.getNumberHistograms()
...
...
@@ -319,4 +346,8 @@ Output
...
Spectrum 77 is ungrouped, it has 1 detector
.. testcleanup:: ExKeep
os.remove( groupingFilePath )
.. 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