From b26b58f520289c410c829dd07d16b3282565b6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Mon, 25 Nov 2024 18:42:26 +0100 Subject: [PATCH] add every option --- labsw/__init__.py | 2 +- labsw/io.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/labsw/__init__.py b/labsw/__init__.py index 472a2ee..75b60b9 100644 --- a/labsw/__init__.py +++ b/labsw/__init__.py @@ -1 +1 @@ -__version__ = '0.1.5.5' +__version__ = '0.1.5.6' diff --git a/labsw/io.py b/labsw/io.py index 77471b0..5c6e8df 100644 --- a/labsw/io.py +++ b/labsw/io.py @@ -26,16 +26,18 @@ def load_data_RH_logger(filepath, every=1): df = df.reset_index() del df['index'] - # Derivative - df['dmdt'] = savgol_filter(df['weight'], window_length=10000, polyorder=1, deriv=1) return df.iloc[::every] -def process_data_RH_logger(filepath): +def process_data_RH_logger(filepath, every): df = load_data_RH_logger(filepath, every=1) + # Derivative + df['dmdt'] = savgol_filter(df['weight'], window_length=10000, polyorder=1, deriv=1) + h5path = os.path.splitext(filepath)[0] h5path += '-processed.h5' + df = df.iloc[::every] df.to_hdf(h5path, key='data')