Commit 5a8b7d50 authored by jansen31's avatar jansen31
Browse files

refactor

parent 6b25506d
......@@ -4,7 +4,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:
def fourier_interpolate(arr: np.ndarray, factor: any = None, **kwargs) -> np.ndarray:
"""
Interpolation by padding in the Fourier domain.
Keyword arguments get passed to sub-functionalities. Options are for example:
......@@ -17,11 +17,13 @@ def fourier_interpolate(arr: np.ndarray, factor: any = 2., **kwargs) -> np.ndarr
:param factor: tuple or float to indicate by which factor to interpolate, default to factor 2
:returns: interpolated array, cast to identical dtype as arr
"""
if factor is None:
factor = 2.
try:
if len(factor) == 2:
out = fourier_interpolate_2d_nonsquare(arr, factor=factor, **kwargs)
elif len(factor) == 3:
out = fourier_interpolate_3d_nonsquare(arr, factor=factor, **kwargs)
out = fourier_interpolate_3d_nonsquare(arr, factor=factor)
else:
raise Exception("This error should never raise")
except TypeError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment