From a599f55cdb219cb3e4174d9e9f53bf0bebf87523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Sierro?= Date: Tue, 29 Aug 2023 09:19:51 +0200 Subject: [PATCH] change: less confusing wspace --- src/scgenerator/math.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/scgenerator/math.py b/src/scgenerator/math.py index 52f6d1b..ca3dbb3 100644 --- a/src/scgenerator/math.py +++ b/src/scgenerator/math.py @@ -187,12 +187,9 @@ def wspace(t: float | np.ndarray, t_num=0): if isinstance(t, (np.ndarray, list, tuple)): dt = t[1] - t[0] t_num = len(t) - t = t[-1] - t[0] + dt else: dt = t / t_num - w = 2 * pi * np.arange(t_num) / t - w = np.where(w >= pi / dt, w - 2 * pi / dt, w) - return w + return np.fft.fftfreq(t_num, dt) * 2 * np.pi def tspace(time_window: float | None = None, t_num: float | None = None, dt: float | None = None):