Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
d6c4f31f
Commit
d6c4f31f
authored
Apr 22, 2020
by
Matthijs
Browse files
bugfix, wrong zoom fraction used
parent
9517285b
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/Problems/OrbitalTomog/phase.py
View file @
d6c4f31f
...
...
@@ -148,7 +148,6 @@ class Phase(Problem):
"""
Processes the solution and generates the output
"""
# TODO: compatibility with non-2d iterates, particularly 3D
# Center the solution (since position is a degree of freedom,
# and if desired, interpolate the results.
center
=
tuple
([
s
//
2
for
s
in
self
.
config
[
'u'
].
shape
])
...
...
@@ -157,15 +156,13 @@ class Phase(Problem):
self
.
output
[
key
]
=
array_tools
.
roll_to_pos
(
self
.
output
[
key
],
pos
=
center
)
# This sequence will work for objects *with a small support* even if they lie over the edge of the array
if
'interpolate_result'
in
self
.
config
and
self
.
config
[
'interpolate_result'
]:
# TODO: compatibility with non-2d iterates, particularly 3D
self
.
output
[
key
]
=
interpolation
.
fourier_interpolate
(
self
.
output
[
key
])
if
'zoomin_on_result'
in
self
.
config
and
self
.
config
[
'zoomin_on_result'
]:
# TODO: compatibility with non-2d iterates, particularly 3D
if
self
.
output
[
key
].
ndim
==
2
:
zmy
,
zmx
=
self
.
output
[
key
].
shape
# self.config['Ny'] // 4, self.config["Nx"] // 4
zmy
,
zmx
=
tuple
([
s
//
4
for
s
in
self
.
output
[
key
].
shape
])
self
.
output
[
key
]
=
self
.
output
[
key
][
zmy
:
-
zmy
,
zmx
:
-
zmx
]
elif
self
.
output
[
key
].
ndim
==
3
:
zmy
,
zmx
,
zmz
=
self
.
output
[
key
].
shape
zmy
,
zmx
,
zmz
=
tuple
([
s
//
4
for
s
in
self
.
output
[
key
].
shape
])
# (self.config['Ny'] // 4, self.config["Nx"] // 4, self.config['Nz'] // 4)
self
.
output
[
key
]
=
self
.
output
[
key
][
zmy
:
-
zmy
,
zmx
:
-
zmx
,
zmz
:
-
zmz
]
...
...
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