Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
6debcd9e
Commit
6debcd9e
authored
Jul 11, 2019
by
Gagik Vardanyan
Browse files
adjusted unit tests for keeping the monitor
parent
a199f404
Changes
2
Hide whitespace changes
Inline
Side-by-side
Framework/DataHandling/test/LoadILLSANSTest.h
View file @
6debcd9e
...
...
@@ -87,8 +87,8 @@ public:
const
auto
&
spec6
=
outputWS
->
y
(
6
).
rawData
();
const
auto
&
err6
=
outputWS
->
e
(
6
).
rawData
();
TS_ASSERT_EQUALS
(
xAxis
.
size
(),
2
)
TS_ASSERT_DELTA
(
xAxis
[
0
],
5.7
2778
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
1
],
6.2
675
7
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
0
],
5.7
3
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
1
],
6.27
,
1E-5
)
TS_ASSERT_EQUALS
(
spec6
[
0
],
20
)
TS_ASSERT_DELTA
(
err6
[
0
],
sqrt
(
20
),
1E-5
)
const
auto
unit
=
outputWS
->
getAxis
(
0
)
->
unit
()
->
unitID
();
...
...
@@ -122,8 +122,8 @@ public:
const
auto
&
spec6
=
outputWS
->
y
(
6
).
rawData
();
const
auto
&
err6
=
outputWS
->
e
(
6
).
rawData
();
TS_ASSERT_EQUALS
(
xAxis
.
size
(),
2
)
TS_ASSERT_DELTA
(
xAxis
[
0
],
4.75
015
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
1
],
5.25
016
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
0
],
4.75
,
1E-5
)
TS_ASSERT_DELTA
(
xAxis
[
1
],
5.25
,
1E-5
)
TS_ASSERT_EQUALS
(
spec6
[
0
],
45
)
TS_ASSERT_DELTA
(
err6
[
0
],
sqrt
(
45
),
1E-5
)
const
auto
unit
=
outputWS
->
getAxis
(
0
)
->
unit
()
->
unitID
();
...
...
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLReductionTest.py
View file @
6debcd9e
...
...
@@ -36,17 +36,17 @@ class SANSILLReductionTest(unittest.TestCase):
def
test_absorber
(
self
):
SANSILLReduction
(
Run
=
'010462'
,
ProcessAs
=
'Absorber'
,
OutputWorkspace
=
'Cd'
)
self
.
_check_output
(
mtd
[
'Cd'
],
True
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'Cd'
],
True
,
1
,
128
*
128
+
2
)
self
.
_check_process_flag
(
mtd
[
'Cd'
],
'Absorber'
)
def
test_beam
(
self
):
SANSILLReduction
(
Run
=
'010414'
,
ProcessAs
=
'Beam'
,
OutputWorkspace
=
'Db'
,
FluxOutputWorkspace
=
'Fl'
)
self
.
_check_output
(
mtd
[
'Db'
],
True
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'Db'
],
True
,
1
,
128
*
128
+
2
)
self
.
_check_process_flag
(
mtd
[
'Db'
],
'Beam'
)
run
=
mtd
[
'Db'
].
getRun
()
self
.
assertAlmostEqual
(
run
.
getLogData
(
'BeamCenterX'
).
value
,
-
0.0048
,
delta
=
1e-4
)
self
.
assertAlmostEqual
(
run
.
getLogData
(
'BeamCenterX'
).
value
,
0.0048
,
delta
=
1e-4
)
self
.
assertAlmostEqual
(
run
.
getLogData
(
'BeamCenterY'
).
value
,
-
0.0027
,
delta
=
1e-4
)
self
.
_check_output
(
mtd
[
'Fl'
],
False
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'Fl'
],
False
,
1
,
128
*
128
+
2
)
self
.
_check_process_flag
(
mtd
[
'Fl'
],
'Beam'
)
self
.
assertAlmostEqual
(
mtd
[
'Fl'
].
readY
(
0
)[
0
],
6628249
,
delta
=
1
)
self
.
assertAlmostEqual
(
mtd
[
'Fl'
].
readE
(
0
)[
0
],
8566
,
delta
=
1
)
...
...
@@ -54,62 +54,62 @@ class SANSILLReductionTest(unittest.TestCase):
def
test_transmission
(
self
):
SANSILLReduction
(
Run
=
'010414'
,
ProcessAs
=
'Beam'
,
OutputWorkspace
=
'Db'
)
SANSILLReduction
(
Run
=
'010585'
,
ProcessAs
=
'Transmission'
,
BeamInputWorkspace
=
'Db'
,
OutputWorkspace
=
'Tr'
)
self
.
assertAlmostEqual
(
mtd
[
'Tr'
].
readY
(
0
)[
0
],
0.64
0
,
delta
=
1e-3
)
self
.
assertAlmostEqual
(
mtd
[
'Tr'
].
readY
(
0
)[
0
],
0.64
2
,
delta
=
1e-3
)
self
.
assertAlmostEqual
(
mtd
[
'Tr'
].
readE
(
0
)[
0
],
0.0019
,
delta
=
1e-4
)
self
.
_check_process_flag
(
mtd
[
'Tr'
],
'Transmission'
)
def
test_container
(
self
):
SANSILLReduction
(
Run
=
'010460'
,
ProcessAs
=
'Container'
,
OutputWorkspace
=
'can'
)
self
.
_check_output
(
mtd
[
'can'
],
True
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'can'
],
True
,
1
,
128
*
128
+
2
)
self
.
_check_process_flag
(
mtd
[
'can'
],
'Container'
)
def
test_reference
(
self
):
SANSILLReduction
(
Run
=
'010453'
,
ProcessAs
=
'Reference'
,
SensitivityOutputWorkspace
=
'sens'
,
OutputWorkspace
=
'water'
)
self
.
_check_output
(
mtd
[
'water'
],
True
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'sens'
],
False
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'water'
],
True
,
1
,
128
*
128
+
2
)
self
.
_check_output
(
mtd
[
'sens'
],
False
,
1
,
128
*
128
+
2
)
self
.
_check_process_flag
(
mtd
[
'water'
],
'Reference'
)
self
.
_check_process_flag
(
mtd
[
'sens'
],
'Sensitivity'
)
def
test_sample
(
self
):
SANSILLReduction
(
Run
=
'010569'
,
ProcessAs
=
'Sample'
,
OutputWorkspace
=
'sample'
)
self
.
_check_output
(
mtd
[
'sample'
],
True
,
1
,
128
*
128
)
self
.
_check_output
(
mtd
[
'sample'
],
True
,
1
,
128
*
128
+
2
)
self
.
_check_process_flag
(
mtd
[
'sample'
],
'Sample'
)
def
test_absorber_tof
(
self
):
# D33 VTOF
# actually this is a container run, not an absorber, but is fine for this test
SANSILLReduction
(
Run
=
'093409'
,
ProcessAs
=
'Absorber'
,
OutputWorkspace
=
'absorber'
)
self
.
_check_output
(
mtd
[
'absorber'
],
True
,
30
,
256
*
256
)
self
.
_check_output
(
mtd
[
'absorber'
],
True
,
30
,
256
*
256
+
2
)
self
.
_check_process_flag
(
mtd
[
'absorber'
],
'Absorber'
)
def
test_beam_tof
(
self
):
# D33 VTOF
SANSILLReduction
(
Run
=
'093406'
,
ProcessAs
=
'Beam'
,
OutputWorkspace
=
'beam'
,
FluxOutputWorkspace
=
'flux'
)
self
.
_check_output
(
mtd
[
'beam'
],
True
,
30
,
256
*
256
)
self
.
_check_output
(
mtd
[
'beam'
],
True
,
30
,
256
*
256
+
2
)
self
.
_check_process_flag
(
mtd
[
'beam'
],
'Beam'
)
run
=
mtd
[
'beam'
].
getRun
()
self
.
assertAlmostEqual
(
run
.
getLogData
(
'BeamCenterX'
).
value
,
-
0.0025
,
delta
=
1e-4
)
self
.
assertAlmostEqual
(
run
.
getLogData
(
'BeamCenterY'
).
value
,
0.0009
,
delta
=
1e-4
)
self
.
_check_output
(
mtd
[
'flux'
],
False
,
30
,
256
*
256
)
self
.
_check_output
(
mtd
[
'flux'
],
False
,
30
,
256
*
256
+
2
)
self
.
_check_process_flag
(
mtd
[
'flux'
],
'Beam'
)
def
test_transmission_tof
(
self
):
# D33 VTOF
SANSILLReduction
(
Run
=
'093406'
,
ProcessAs
=
'Beam'
,
OutputWorkspace
=
'beam'
)
SANSILLReduction
(
Run
=
'093407'
,
ProcessAs
=
'Transmission'
,
BeamInputWorkspace
=
'beam'
,
OutputWorkspace
=
'ctr'
)
self
.
_check_output
(
mtd
[
'ctr'
],
False
,
7
5
,
1
)
self
.
_check_output
(
mtd
[
'ctr'
],
False
,
9
7
,
1
)
def
test_reference_tof
(
self
):
# D33 VTOF
# this is actually a sample run, not water, but is fine for this test
SANSILLReduction
(
Run
=
'093410'
,
ProcessAs
=
'Reference'
,
OutputWorkspace
=
'ref'
)
self
.
_check_output
(
mtd
[
'ref'
],
True
,
30
,
256
*
256
)
self
.
_check_output
(
mtd
[
'ref'
],
True
,
30
,
256
*
256
+
2
)
self
.
_check_process_flag
(
mtd
[
'ref'
],
'Reference'
)
def
test_sample_tof
(
self
):
# D33 VTOF, Pluronic F127
SANSILLReduction
(
Run
=
'093410'
,
ProcessAs
=
'Sample'
,
OutputWorkspace
=
'sample'
)
self
.
_check_output
(
mtd
[
'sample'
],
True
,
30
,
256
*
256
)
self
.
_check_output
(
mtd
[
'sample'
],
True
,
30
,
256
*
256
+
2
)
self
.
_check_process_flag
(
mtd
[
'sample'
],
'Sample'
)
def
_check_process_flag
(
self
,
ws
,
value
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment