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
15bb56ca
Commit
15bb56ca
authored
10 years ago
by
Arturs Bekasovs
Browse files
Options
Downloads
Patches
Plain Diff
Refs #9568. MuonCalculateAsymmetry
Plus a small fix for it in alg. property default value display
parent
cfc10eb0
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/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst
+50
-0
50 additions, 0 deletions
...ntid/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst
Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py
+6
-0
6 additions, 0 deletions
.../Mantid/docs/sphinxext/mantiddoc/directives/properties.py
with
56 additions
and
0 deletions
Code/Mantid/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst
+
50
−
0
View file @
15bb56ca
...
...
@@ -24,4 +24,54 @@ For every mode, either one or two data acquisition period workspaces can
be provided. PeriodOperation determines in which way period data will be
merged at the end.
Usage
-----
**Example - Pair asymmetry for a single period:**
.. testcode:: ExPairAsymmetry
y = [1,2,3] + [4,5,6]
x = [1,2,3] * 2
input = CreateWorkspace(x, y, NSpec=2)
output = MuonCalculateAsymmetry(FirstPeriodWorkspace = input,
OutputType = 'PairAsymmetry',
PairFirstIndex = 1,
PairSecondIndex = 0,
Alpha = 0.5)
print 'Output:', ', '.join('{:.3f}'.format(y) for y in output.readY(0))
Output:
.. testoutput:: ExPairAsymmetry
Output: 0.778, 0.667, 0.600
**Example - Group asymmetry for two periods:**
.. testcode:: ExGroupAsymmetryMultiperiod
y1 = [100,50,10]
y2 = [150,20,1]
x = [1,2,3]
input1 = CreateWorkspace(x, y1)
input2 = CreateWorkspace(x, y2)
output = MuonCalculateAsymmetry(FirstPeriodWorkspace = input1,
SecondPeriodWorkspace = input2,
PeriodOperation = '-',
OutputType = 'GroupAsymmetry',
GroupIndex = 0)
print 'Output:', ', '.join('{:.3f}'.format(y) for y in output.readY(0))
Output:
.. testoutput:: ExGroupAsymmetryMultiperiod
Output: -0.286, 0.606, 0.263
.. categories::
This diff is collapsed.
Click to expand it.
Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py
+
6
−
0
View file @
15bb56ca
from
base
import
BaseDirective
import
string
class
PropertiesDirective
(
BaseDirective
):
...
...
@@ -140,6 +141,11 @@ class PropertiesDirective(BaseDirective):
# Fall-back default for anything
defaultstr
=
str
(
default
)
# A special case for single-character default values (e.g. + or *, see MuonLoad). We don't
# want them to be interpreted as list items.
if
len
(
defaultstr
)
==
1
and
defaultstr
in
string
.
punctuation
:
defaultstr
=
"
\\
"
+
defaultstr
# Replace the ugly default values with "Optional"
if
(
defaultstr
==
"
8.9884656743115785e+307
"
)
or
\
(
defaultstr
==
"
1.7976931348623157e+308
"
)
or
\
...
...
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