diff --git a/analysis.py b/analysis.py index 99bc3af..0349e53 100644 --- a/analysis.py +++ b/analysis.py @@ -9,10 +9,16 @@ stability_file = "out_stability.csv" degradation_file = "out_degradation.csv" paper_names = { - 2: "Glossy Pro Platinum", - 3: "Photo Fine-Grained Luster", - 4: "Matte Photo", - 5: "Photo Premium Matte", + "1A": "Glossy Pro Platinum (open)", + "1B": "Glossy Pro Platinum (close)", + "2A": "Photo Fine-Grained Luster (open)", + "2B": "Photo Fine-Grained Luster (close)", + "3A": "Photo Premium Matte (open)", + "3B": "Photo Premium Matte (close)", + "4A": "Matte Photo (open)", + "4B": "Matte Photo (close)", + "5A": "ELECOM Matte Photo (open)", + "5B": "ELECOM Matte Photo (close)", } data_dir = r"D:\usr\prog\CM700Reader" @@ -24,15 +30,15 @@ files = [f for f in os.listdir(data_dir) if f.endswith(".csv")] all_data = pd.DataFrame() for i, file in enumerate(files): - if not file.startswith("dobot"): + if not file.startswith("tcc6"): continue file_path = os.path.join(data_dir, file) parts = os.path.splitext(os.path.basename(file))[0].split("_") - paper = 2 + paper = parts[0][5:7] datestr = parts[1] + "-" + parts[2] - iter = 0 if file[11:12] == "a" else 1 + # iter = 0 if file[11:12] == "a" else 1 iter = 0 - # print(f"Reading {file_path} (Paper: {paper}, Date: {datestr}, Iteration: {iter})") + print(f"Reading {file_path} (Paper: {paper}, Date: {datestr}, Iteration: {iter})") df = pd.read_csv(file_path, encoding="utf-8") df["tcc"] = df["no"].astype("int") df["paper"] = paper @@ -41,6 +47,10 @@ # df.drop(columns=["no", "X", "Y", "Z"], inplace=True, errors="ignore") # df.drop(columns=[f"{c:.1f}" for c in range(400, 710, 10)], inplace=True, errors="ignore") all_data = pd.concat([all_data, df], ignore_index=True) + if all_data.empty: + print("No data found in the specified directory.") + exit(1) + all_data.sort_values(by=["date", "paper", "iter", "tcc"], inplace=True) # Save the combined DataFrame to a CSV file all_data[["date", "paper", "iter", "tcc", "L*", "a*", "b*"]].to_csv(