diff --git a/scripts/recompute.py b/scripts/recompute.py new file mode 100644 index 0000000..f405c17 --- /dev/null +++ b/scripts/recompute.py @@ -0,0 +1,27 @@ +import pandas as pd +import os +import numpy as np +import re +import math + +curdir = os.getcwd() +path_delim = '/' +df = pd.read_excel(curdir + path_delim + "data/data_22_09_2023_05_29.xlsx", sheet_name="data") + +def parse(resultData, idx): + result = [line.strip() for line in resultData.split("\n") if "RESULT" in line and "REND" in line] + # print(result[-1].split(' ')) + return result[-1].split(' ')[idx] + +df["led1BufferRc"] = df.apply(lambda x: parse(x['resultData'], 3), axis=1) +df["led1SampleRc"] = df.apply(lambda x: parse(x['resultData'], 5), axis=1) +df["led2BufferRc"] = df.apply(lambda x: parse(x['resultData'], 4), axis=1) +df["led2SampleRc"] = df.apply(lambda x: parse(x['resultData'], 6), axis=1) + +print(df) +# df["absorbance"] = df.apply(lambda x: float(x["led1BufferRc"])/float(x["led1SampleRc"])) + + +writer = pd.ExcelWriter(curdir + path_delim + "data/recompute2.xlsx", engine = 'openpyxl') +df.to_excel(writer, sheet_name = 'op', index=False) +writer.close() \ No newline at end of file