diff --git a/labsw/__init__.py b/labsw/__init__.py index 91523c0..d2a6d5c 100644 --- a/labsw/__init__.py +++ b/labsw/__init__.py @@ -1 +1 @@ -__version__ = '0.1.6.0' +__version__ = '0.1.6.1' diff --git a/labsw/io.py b/labsw/io.py index 784c176..a58155f 100644 --- a/labsw/io.py +++ b/labsw/io.py @@ -20,8 +20,6 @@ def load_data_RH_logger(filepath, every=1): df = df.drop(columns='X') df = df.drop(np.arange(1)) - df['dm_m'] = (df['weight'] - df['weight'].iloc[0]) / df['weight'].iloc[0] - # Crop data df = df.reset_index() del df['index'] @@ -32,10 +30,19 @@ def load_data_RH_logger(filepath, every=1): def process_data_RH_logger(filepath, every): df = load_data_RH_logger(filepath, every=1) + + # Variation + df['dm'] = df['weight'] - df['weight'].iloc[0] + df['dm_m'] = (df['weight'] - df['weight'].iloc[0]) / df['weight'].iloc[0] + + # weight normalized between 0 and 1 begin to end + mf = df['dm_m'].tail(300).mean() + df['m_mf'] = df['dm_m'] / mf + # Derivative 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) + df['dMdt_SG'] = savgol_filter(df['dm_m'], window_length=10000, polyorder=1, deriv=1, delta=delta) + df['dMdt_diff'] = df['dm_m'].diff(periods=1000) / df['time'].diff(periods=1000) h5path = os.path.splitext(filepath)[0] h5path += '-processed.h5'