fix(data): update output file naming to include customizable prefix
This commit is contained in:
@@ -33,7 +33,7 @@ def create_damage_files(base_path, output_base, prefix):
|
|||||||
top_sensor = columns[i-1]
|
top_sensor = columns[i-1]
|
||||||
print(top_sensor, type(top_sensor))
|
print(top_sensor, type(top_sensor))
|
||||||
output_file_1 = os.path.join(output_base, f'DAMAGE_{damage}', f'DAMAGE{damage}_TEST{i}_01.csv')
|
output_file_1 = os.path.join(output_base, f'DAMAGE_{damage}', f'DAMAGE{damage}_TEST{i}_01.csv')
|
||||||
print(f"Creating {output_file_1} from taking zzzAD{file_index}.TXT")
|
print(f"Creating {output_file_1} from taking zzz{prefix}D{file_index}.TXT")
|
||||||
print("Taking datetime column on index 0...")
|
print("Taking datetime column on index 0...")
|
||||||
print(f"Taking `{top_sensor}`...")
|
print(f"Taking `{top_sensor}`...")
|
||||||
df[['Time', top_sensor]].to_csv(output_file_1, index=False)
|
df[['Time', top_sensor]].to_csv(output_file_1, index=False)
|
||||||
@@ -41,7 +41,7 @@ def create_damage_files(base_path, output_base, prefix):
|
|||||||
|
|
||||||
bottom_sensor = sensor_end_map[i]
|
bottom_sensor = sensor_end_map[i]
|
||||||
output_file_2 = os.path.join(output_base, f'DAMAGE_{damage}', f'DAMAGE{damage}_TEST{i}_02.csv')
|
output_file_2 = os.path.join(output_base, f'DAMAGE_{damage}', f'DAMAGE{damage}_TEST{i}_02.csv')
|
||||||
print(f"Creating {output_file_2} from taking zzzAD{file_index}.TXT")
|
print(f"Creating {output_file_2} from taking zzz{prefix}D{file_index}.TXT")
|
||||||
print("Taking datetime column on index 0...")
|
print("Taking datetime column on index 0...")
|
||||||
print(f"Taking `{bottom_sensor}`...")
|
print(f"Taking `{bottom_sensor}`...")
|
||||||
df[['Time', bottom_sensor]].to_csv(output_file_2, index=False)
|
df[['Time', bottom_sensor]].to_csv(output_file_2, index=False)
|
||||||
|
|||||||
Reference in New Issue
Block a user