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
bcef1655
Commit
bcef1655
authored
6 years ago
by
Sam Jenkins
Browse files
Options
Downloads
Patches
Plain Diff
Re #24073 added system test for vanadium generation
parent
56dd291c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/SystemTests/tests/analysis/ISIS_WISHPowderReductionTest.py
+51
-9
51 additions, 9 deletions
...ystemTests/tests/analysis/ISIS_WISHPowderReductionTest.py
scripts/wish/reduce.py
+6
-7
6 additions, 7 deletions
scripts/wish/reduce.py
with
57 additions
and
16 deletions
Testing/SystemTests/tests/analysis/ISIS_WISHPowderReductionTest.py
+
51
−
9
View file @
bcef1655
...
@@ -27,6 +27,14 @@ input_dir = os.path.join(working_dir, input_folder_name)
...
@@ -27,6 +27,14 @@ input_dir = os.path.join(working_dir, input_folder_name)
output_dir
=
os
.
path
.
join
(
working_dir
,
output_folder_name
)
output_dir
=
os
.
path
.
join
(
working_dir
,
output_folder_name
)
calibration_dir
=
os
.
path
.
join
(
input_dir
,
calibration_folder_name
)
calibration_dir
=
os
.
path
.
join
(
input_dir
,
calibration_folder_name
)
panels
=
[
5
,
6
]
linked_panels
=
{
1
:
10
,
2
:
9
,
3
:
8
,
4
:
7
,
5
:
6
}
class
WISHPowderReductionTest
(
MantidSystemTest
):
class
WISHPowderReductionTest
(
MantidSystemTest
):
...
@@ -44,29 +52,63 @@ class WISHPowderReductionTest(MantidSystemTest):
...
@@ -44,29 +52,63 @@ class WISHPowderReductionTest(MantidSystemTest):
return
input_files
return
input_files
def
cleanup
(
self
):
def
cleanup
(
self
):
shutil
.
rmtree
(
output_dir
)
if
os
.
path
.
isdir
(
output_dir
):
shutil
.
rmtree
(
output_dir
)
def
runTest
(
self
):
def
runTest
(
self
):
os
.
makedirs
(
output_dir
)
os
.
makedirs
(
output_dir
)
wish_test
=
Wish
(
"
__main__
"
,
calibration_dir
+
"
/
"
,
output_dir
+
"
/
"
,
True
,
input_dir
)
wish_test
=
Wish
(
calibration_dir
+
"
/
"
,
output_dir
+
"
/
"
,
True
,
input_dir
)
runs
=
[
40503
]
runs
=
[
40503
]
panels
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]
wish_test
.
reduce
(
runs
,
panels
)
wish_test
.
reduce
(
runs
,
panels
)
self
.
clearWorkspaces
()
self
.
clearWorkspaces
()
def
validate
(
self
):
def
validate
(
self
):
return
"
w40503-1_10foc
"
,
"
WISH40503-1_10raw.nxs
"
,
\
validation_files
=
[]
"
w40503-2_9foc
"
,
"
WISH40503-2_9raw.nxs
"
,
\
for
panel
in
[
x
for
x
in
panels
if
x
<
6
]:
"
w40503-3_8foc
"
,
"
WISH40503-3_8raw.nxs
"
,
\
validation_files
=
validation_files
+
[
"
w40503-{0}_{1}foc
"
.
format
(
panel
,
linked_panels
.
get
(
panel
)),
"
w40503-4_7foc
"
,
"
WISH40503-
4_7
raw.nxs
"
,
\
"
WISH40503-
{0}_{1}
raw.nxs
"
.
format
(
panel
,
linked_panels
.
get
(
panel
))]
"
w40503-5_6foc
"
,
"
WISH40503-5_6raw.nxs
"
return
validation_files
def
clearWorkspaces
(
self
):
def
clearWorkspaces
(
self
):
deletews
=
[
"
w40503-
"
+
str
(
i
)
+
"
foc
"
for
i
in
r
an
ge
(
5
,
7
)
]
deletews
=
[
"
w40503-
{}foc
"
.
format
(
panel
)
for
panel
in
p
an
els
]
for
ws
in
deletews
:
for
ws
in
deletews
:
mantid
.
DeleteWorkspace
(
ws
)
mantid
.
DeleteWorkspace
(
ws
)
mantid
.
DeleteWorkspace
(
ws
+
"
-d
"
)
mantid
.
DeleteWorkspace
(
ws
+
"
-d
"
)
# Skip test when on builds as extremely slow, run only as reversion test for wish script
def
skipTests
(
self
):
return
True
class
WISHPowderReductionCreateVanadiumTest
(
MantidSystemTest
):
# still missing required files check with ./systemtest -R PowderReduction --showskipped
def
requiredFiles
(
self
):
input_files
=
[
"
emptyinst19618-2foc-SF-S.nxs
"
,
"
emptyinst19618-3foc-SF-S.nxs
"
,
"
emptyinst19618-4foc-SF-S.nxs
"
,
"
emptyinst19618-5foc-SF-S.nxs
"
,
"
emptyinst19618-6foc-SF-S.nxs
"
,
"
emptyinst19618-7foc-SF-S.nxs
"
,
"
emptyinst19618-8foc-SF-S.nxs
"
,
"
emptyinst19618-9foc-SF-S.nxs
"
,
"
emptyinst19618-10foc-SF-S.nxs
"
]
input_files
=
[
os
.
path
.
join
(
calibration_dir
,
files
)
for
files
in
input_files
]
return
input_files
def
cleanup
(
self
):
if
os
.
path
.
isdir
(
output_dir
):
shutil
.
rmtree
(
output_dir
)
def
runTest
(
self
):
os
.
makedirs
(
output_dir
)
wish_test
=
Wish
(
calibration_dir
+
"
/
"
,
output_dir
+
"
/
"
,
True
,
input_dir
)
wish_test
.
create_vanadium_run
(
19612
,
19618
,
panels
)
def
validate
(
self
):
validation_files
=
[]
for
panel
in
[
x
for
x
in
panels
if
x
<
6
]:
validation_files
=
validation_files
+
[
"
w19612-{}foc
"
.
format
(
panel
),
"
vana19612-{}foc-SF-SS.nxs
"
.
format
(
panel
)]
print
(
validation_files
)
return
validation_files
# Skip test when on builds as extremely slow, run only as reversion test for wish script
# Skip test when on builds as extremely slow, run only as reversion test for wish script
def
skipTests
(
self
):
def
skipTests
(
self
):
return
False
return
False
This diff is collapsed.
Click to expand it.
scripts/wish/reduce.py
+
6
−
7
View file @
bcef1655
...
@@ -9,9 +9,8 @@ class Wish:
...
@@ -9,9 +9,8 @@ class Wish:
NUM_MONITORS
=
6
NUM_MONITORS
=
6
LAMBDA_RANGE
=
(
0.7
,
10.35
)
LAMBDA_RANGE
=
(
0.7
,
10.35
)
def
__init__
(
self
,
input_mode
,
cal_directory
,
output_folder
,
delete_workspace
,
def
__init__
(
self
,
cal_directory
,
output_folder
,
delete_workspace
,
user_directory
=
"
/archive/ndxwish/Instrument/data/cycle_
"
):
user_directory
=
"
/archive/ndxwish/Instrument/data/cycle_
"
):
self
.
name
=
input_mode
self
.
cal_dir
=
cal_directory
self
.
cal_dir
=
cal_directory
self
.
use_folder
=
user_directory
self
.
use_folder
=
user_directory
self
.
out_folder
=
output_folder
self
.
out_folder
=
output_folder
...
@@ -257,10 +256,12 @@ class Wish:
...
@@ -257,10 +256,12 @@ class Wish:
# save a a nexus processed file.
# save a a nexus processed file.
# It looks like smoothing of 100 works quite well
# It looks like smoothing of 100 works quite well
def
process_vanadium
(
self
,
van
,
empty
,
panel
,
vh
,
vr
,
cycle_van
=
"
09_3
"
,
cycle_empty
=
"
09_3
"
):
def
process_vanadium
(
self
,
van
,
empty
,
panel
,
vh
,
vr
,
cycle_van
=
"
09_3
"
,
cycle_empty
=
"
09_3
"
):
self
.
data_directory
=
"
/archive/ndxwish/Instrument/data/cycle_
"
+
cycle_van
+
"
/
"
user_data_directory
=
self
.
use_folder
+
cycle_van
+
'
/
'
self
.
set_data_directory
(
user_data_directory
)
self
.
datafile
=
self
.
get_file_name
(
van
,
"
raw
"
)
self
.
datafile
=
self
.
get_file_name
(
van
,
"
raw
"
)
wvan
=
self
.
read
(
van
,
panel
,
"
raw
"
)
wvan
=
self
.
read
(
van
,
panel
,
"
raw
"
)
self
.
data_directory
=
"
/archive/ndxwish/Instrument/data/cycle_
"
+
cycle_empty
+
"
/
"
user_data_directory
=
self
.
use_folder
+
cycle_empty
+
'
/
'
self
.
set_data_directory
(
user_data_directory
)
self
.
datafile
=
self
.
get_file_name
(
empty
,
"
raw
"
)
self
.
datafile
=
self
.
get_file_name
(
empty
,
"
raw
"
)
wempty
=
self
.
read
(
empty
,
panel
,
"
raw
"
)
wempty
=
self
.
read
(
empty
,
panel
,
"
raw
"
)
mantid
.
Minus
(
LHSWorkspace
=
wvan
,
RHSWorkspace
=
wempty
,
OutputWorkspace
=
wvan
)
mantid
.
Minus
(
LHSWorkspace
=
wvan
,
RHSWorkspace
=
wempty
,
OutputWorkspace
=
wvan
)
...
@@ -368,9 +369,7 @@ class Wish:
...
@@ -368,9 +369,7 @@ class Wish:
EMode
=
"
Elastic
"
)
EMode
=
"
Elastic
"
)
if
0
in
panels
:
if
0
in
panels
:
panels
=
[
1
,
2
,
3
,
4
,
5
]
panels
=
[
1
,
2
,
3
,
4
,
5
]
else
:
for
panel
in
[
x
for
x
in
panels
if
x
<
6
]:
panels
=
[
x
for
x
in
panels
if
x
<
6
]
for
panel
in
panels
:
self
.
save_combined_panel
(
run
,
panel
)
self
.
save_combined_panel
(
run
,
panel
)
def
save_combined_panel
(
self
,
run
,
panel
):
def
save_combined_panel
(
self
,
run
,
panel
):
...
...
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