From 4889c8ca21f896507628715b0fe9b97ccc3c31bd Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 30 Mar 2022 10:49:02 +0200 Subject: [PATCH] Remove dt from config --- swash/config-nb.ini | 1 - swash/config.ini | 1 - swash/processing/post.py | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/swash/config-nb.ini b/swash/config-nb.ini index fd56912..af53a8b 100644 --- a/swash/config-nb.ini +++ b/swash/config-nb.ini @@ -12,6 +12,5 @@ inp=inp_post/spec_nb compare=inp_post_nb out=out_post #nperseg=1024 -dt=0.25 x0=-1250 t0=180 diff --git a/swash/config.ini b/swash/config.ini index 1a58cea..43f34d8 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -12,6 +12,5 @@ inp=inp_post/spec compare=inp_post_nb out=out_post #nperseg=1024 -dt=0.25 x0=-1250 t0=180 diff --git a/swash/processing/post.py b/swash/processing/post.py index ca6a785..0d1a0c1 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -38,7 +38,7 @@ x0 = config.getint("post", "x0") arg_x0 = np.abs(x - x0).argmin() t0 = config.getfloat("post", "t0") arg_t0 = np.abs(t - t0).argmin() -dt = config.getfloat("post", "dt") +dt = np.diff(t).mean() f = 1 / dt nperseg = config.getint("post", "nperseg", fallback=None) log.info(f"Computing reflection coefficient at x={x0}")