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
eedb82bd
Commit
eedb82bd
authored
9 years ago
by
Marina Ganeva
Browse files
Options
Downloads
Patches
Plain Diff
One more unittest.
parent
ae22d4a9
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/PythonInterface/test/python/plugins/algorithms/DNSDetEffCorrVanaTest.py
+25
-0
25 additions, 0 deletions
...e/test/python/plugins/algorithms/DNSDetEffCorrVanaTest.py
with
25 additions
and
0 deletions
Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSDetEffCorrVanaTest.py
+
25
−
0
View file @
eedb82bd
...
...
@@ -100,6 +100,31 @@ class DNSDetEffCorrVanaTest(unittest.TestCase):
BkgWorkspace
=
self
.
__vanaws
.
getName
())
return
def
test_TwoTheta
(
self
):
# check whether the 2theta angles the same as in the data workspace
outputWorkspaceName
=
"
DNSDetCorrVanaTest_Test5
"
# rotate detector bank to different angles
api
.
RotateInstrumentComponent
(
self
.
__dataws
,
"
bank0
"
,
X
=
0
,
Y
=
1
,
Z
=
0
,
Angle
=-
7.53
)
api
.
RotateInstrumentComponent
(
self
.
__vanaws
,
"
bank0
"
,
X
=
0
,
Y
=
1
,
Z
=
0
,
Angle
=-
8.02
)
api
.
RotateInstrumentComponent
(
self
.
__bkgrws
,
"
bank0
"
,
X
=
0
,
Y
=
1
,
Z
=
0
,
Angle
=-
8.54
)
# run correction
alg_test
=
run_algorithm
(
"
DNSDetEffCorrVana
"
,
InputWorkspace
=
self
.
__dataws
.
getName
(),
OutputWorkspace
=
outputWorkspaceName
,
VanaWorkspace
=
self
.
__vanaws
.
getName
(),
BkgWorkspace
=
self
.
__bkgrws
.
getName
())
self
.
assertTrue
(
alg_test
.
isExecuted
())
# check dimensions and angles
ws
=
AnalysisDataService
.
retrieve
(
outputWorkspaceName
)
# dimensions
self
.
assertEqual
(
24
,
ws
.
getNumberHistograms
())
self
.
assertEqual
(
2
,
ws
.
getNumDims
())
# angles
tthetas
=
np
.
array
([
7.53
+
i
*
5
for
i
in
range
(
24
)])
for
i
in
range
(
24
):
det
=
ws
.
getDetector
(
i
)
self
.
assertAlmostEqual
(
tthetas
[
i
],
np
.
degrees
(
ws
.
detectorSignedTwoTheta
(
det
)))
run_algorithm
(
"
DeleteWorkspace
"
,
Workspace
=
outputWorkspaceName
)
return
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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