Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
48e2adc8
Commit
48e2adc8
authored
Jan 22, 2021
by
Richard Waite
Browse files
Fix divide by zero error if no background supplied
parent
c8555c70
Changes
1
Hide whitespace changes
Inline
Side-by-side
qt/python/mantidqt/widgets/sliceviewer/peaksviewer/representation/ellipsoid.py
View file @
48e2adc8
...
...
@@ -118,11 +118,15 @@ def _bkgd_ellipsoid_info(shape_info):
"""
a
,
b
,
c
=
float
(
shape_info
[
"background_outer_radius0"
]),
float
(
shape_info
[
"background_outer_radius1"
]),
float
(
shape_info
[
"background_outer_radius2"
])
inner_a
,
inner_b
,
inner_c
=
float
(
shape_info
[
"background_inner_radius0"
]),
float
(
shape_info
[
"background_inner_radius1"
]),
float
(
shape_info
[
"background_inner_radius2"
])
width
=
(
max
((
a
,
b
,
c
))
-
max
((
inner_a
,
inner_b
,
inner_c
)))
/
max
((
a
,
b
,
c
))
# fractional width of shell
return
(
a
,
b
,
c
,
width
)
if
min
([
a
,
b
,
c
])
>
1e-15
:
inner_a
,
inner_b
,
inner_c
=
float
(
shape_info
[
"background_inner_radius0"
]),
float
(
shape_info
[
"background_inner_radius1"
]),
float
(
shape_info
[
"background_inner_radius2"
])
width
=
(
max
((
a
,
b
,
c
))
-
max
((
inner_a
,
inner_b
,
inner_c
)))
/
max
((
a
,
b
,
c
))
# fractional width of shell
else
:
# no background specified (inner bg defaults to peak radius) assign unphysical width
width
=
-
1
return
a
,
b
,
c
,
width
def
slice_ellipsoid
(
origin
,
axis_a
,
axis_b
,
axis_c
,
a
,
b
,
c
,
zp
,
transform
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment