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
21fe25ae
Commit
21fe25ae
authored
6 years ago
by
Sam Jenkins
Browse files
Options
Downloads
Patches
Plain Diff
Re #23690 Fixed issue with overwriting focus results
parent
718000e6
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/Diffraction/isis_powder/routines/focus.py
+4
-5
4 additions, 5 deletions
scripts/Diffraction/isis_powder/routines/focus.py
with
4 additions
and
5 deletions
scripts/Diffraction/isis_powder/routines/focus.py
+
4
−
5
View file @
21fe25ae
...
...
@@ -120,9 +120,8 @@ def _divide_one_spectrum_by_spline(spectrum, spline, instrument):
if
instrument
.
get_instrument_prefix
()
==
"
GEM
"
:
divided
=
mantid
.
Divide
(
LHSWorkspace
=
spectrum
,
RHSWorkspace
=
rebinned_spline
,
OutputWorkspace
=
spectrum
,
StoreInADS
=
False
)
output
=
_crop_spline_to_percent_of_max
(
rebinned_spline
,
divided
)
mantid
.
mtd
[
'
output
'
]
=
output
return
output
return
_crop_spline_to_percent_of_max
(
rebinned_spline
,
divided
,
spectrum
)
divided
=
mantid
.
Divide
(
LHSWorkspace
=
spectrum
,
RHSWorkspace
=
rebinned_spline
,
OutputWorkspace
=
spectrum
)
return
divided
...
...
@@ -167,7 +166,7 @@ def _test_splined_vanadium_exists(instrument, run_details):
"
\n
Have you run the method to create a Vanadium spline with these settings yet?
\n
"
)
def
_crop_spline_to_percent_of_max
(
spline
,
input_ws
):
def
_crop_spline_to_percent_of_max
(
spline
,
input_ws
,
spectrum
):
spline_spectrum
=
spline
.
readY
(
0
)
y_val
=
numpy
.
amax
(
spline_spectrum
)
y_val
=
y_val
/
100
...
...
@@ -175,5 +174,5 @@ def _crop_spline_to_percent_of_max(spline, input_ws):
small_spline_indecies
=
numpy
.
nonzero
(
spline_spectrum
>
y_val
)[
0
]
x_max
=
x_list
[
small_spline_indecies
[
-
1
]]
x_min
=
x_list
[
small_spline_indecies
[
0
]]
output
=
mantid
.
CropWorkspace
(
inputWorkspace
=
input_ws
,
XMin
=
x_min
,
XMax
=
x_max
,
StoreInADS
=
False
)
output
=
mantid
.
CropWorkspace
(
inputWorkspace
=
input_ws
,
XMin
=
x_min
,
XMax
=
x_max
,
OutputWorkspace
=
spectrum
)
return
output
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