From 2c908e05b5b76fda4cd25703e9fc8e8536863497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Tue, 26 Nov 2024 07:29:54 +0100 Subject: [PATCH] add delta value to SG --- labsw/__init__.py | 2 +- labsw/io.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/labsw/__init__.py b/labsw/__init__.py index 8f5a3fd..91523c0 100644 --- a/labsw/__init__.py +++ b/labsw/__init__.py @@ -1 +1 @@ -__version__ = '0.1.5.8' +__version__ = '0.1.6.0' diff --git a/labsw/io.py b/labsw/io.py index 459cacb..784c176 100644 --- a/labsw/io.py +++ b/labsw/io.py @@ -33,7 +33,8 @@ def load_data_RH_logger(filepath, every=1): def process_data_RH_logger(filepath, every): df = load_data_RH_logger(filepath, every=1) # Derivative - df['dmdt_SG'] = savgol_filter(df['weight'], window_length=10000, polyorder=1, deriv=1) + delta = np.mean(df['time'].diff()) + df['dmdt_SG'] = savgol_filter(df['weight'], window_length=10000, polyorder=1, deriv=1, delta=delta) df['dmdt_diff'] = df['weight'].diff(periods=1000) / df['time'].diff(periods=1000) h5path = os.path.splitext(filepath)[0]