|
|
|
@ -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'
|
|
|
|
|