From 25c5f7dd9d80a5b72fda82943af62fcf5d36fb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Thu, 5 Dec 2024 11:33:36 +0100 Subject: [PATCH] pass params --- labsw/__init__.py | 2 +- labsw/io.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/labsw/__init__.py b/labsw/__init__.py index 4740c52..a67bd07 100644 --- a/labsw/__init__.py +++ b/labsw/__init__.py @@ -1 +1 @@ -__version__ = '0.1.6.6' +__version__ = '0.1.6.7' diff --git a/labsw/io.py b/labsw/io.py index 140f915..e24e5b8 100644 --- a/labsw/io.py +++ b/labsw/io.py @@ -42,7 +42,7 @@ def load_data_RH_logger(filepath, every=1): return df.iloc[::every] -def process_data_RH_logger(filepath, every): +def process_data_RH_logger(filepath, every, diff_period=1_000, SG_window=10_000): df = load_data_RH_logger(filepath, every=1) # Variation @@ -55,11 +55,11 @@ def process_data_RH_logger(filepath, every): # Derivative delta = np.mean(df['time'].diff()) - df['dMdt_SG'] = savgol_filter(df['m_mf'], window_length=10000, polyorder=1, deriv=1, delta=delta) - df['dMdt_diff'] = df['m_mf'].diff(periods=1000) / df['time'].diff(periods=1000) + df['dMdt_SG'] = savgol_filter(df['m_mf'], window_length=SG_window, polyorder=1, deriv=1, delta=delta) + df['dMdt_diff'] = df['m_mf'].diff(periods=diff_period) / df['time'].diff(periods=diff_period) - df['dweightdt_SG'] = savgol_filter(df['weight'], window_length=10000, polyorder=1, deriv=1, delta=delta) - df['dweightdt_diff'] = df['weight'].diff(periods=1000) / df['time'].diff(periods=1000) + df['dweightdt_SG'] = savgol_filter(df['weight'], window_length=SG_window, polyorder=1, deriv=1, delta=delta) + df['dweightdt_diff'] = df['weight'].diff(periods=diff_period) / df['time'].diff(periods=diff_period) h5path = os.path.splitext(filepath)[0] h5path += '-processed.h5'