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
e611fb11
Commit
e611fb11
authored
Apr 29, 2020
by
Matthijs
Browse files
prevent numpy ComplexWarnings
parent
fcee5c09
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/Utilities/OrbitalTomog/interpolation.py
View file @
e611fb11
...
...
@@ -3,6 +3,7 @@ from .array_tools import shifted_fft, shifted_ifft, roll_to_pos
__all__
=
[
'fourier_interpolate'
]
def
fourier_interpolate
(
arr
:
np
.
ndarray
,
factor
:
any
=
2.
,
**
kwargs
)
->
np
.
ndarray
:
"""
Interpolation by padding in the Fourier domain.
...
...
@@ -30,7 +31,10 @@ def fourier_interpolate(arr: np.ndarray, factor: any = 2., **kwargs) -> np.ndarr
out
=
fourier_interpolate_3d
(
arr
,
factor
=
factor
,
**
kwargs
)
else
:
raise
NotImplementedError
(
'Can only interpolate 2d or 3d arrays as of now'
)
return
out
.
astype
(
arr
.
dtype
,
casting
=
'unsafe'
)
if
np
.
isrealobj
(
arr
):
return
out
.
real
.
astype
(
arr
.
dtype
,
casting
=
'unsafe'
)
else
:
return
out
.
astype
(
arr
.
dtype
,
casting
=
'unsafe'
)
def
fourier_interpolate_2d_nonsquare
(
arr
:
np
.
ndarray
,
factor
:
tuple
=
(
1.
,
2.
),
...
...
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