<jupyter_start><jupyter_text>Analysis of Results{{text_file = open("experiment_details.txt")}}{{file_content = text_file.read()}}{{print(file_content)}}{{text_file.close()}} Synchronised Cameras Run 2<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
subset_0_data = pd.read_csv("output_folderDICe_solution_0.txt")
subset_1_data = pd.read_csv("output_folderDICe_solution_1.txt")
subset_2_data = pd.read_csv("output_folderDICe_solution_2.txt")
z_displacement_0 = subset_0_data.MODEL_DISPLACEMENT_Z
z_displacement_1 = subset_1_data.MODEL_DISPLACEMENT_Z
z_displacement_2 = subset_2_data.MODEL_DISPLACEMENT_Z
z_displacement_0 = z_displacement_0[40:140]
z_displacement_1 = z_displacement_1[40:140]
z_displacement_2 = z_displacement_2[40:140]
z_displacement_0 *= -1
z_displacement_1 *= -1
z_displacement_2 *= -1

y_displacement_0 = subset_0_data.MODEL_DISPLACEMENT_Y
y_displacement_1 = subset_1_data.MODEL_DISPLACEMENT_Y
y_displacement_2 = subset_2_data.MODEL_DISPLACEMENT_Y
y_displacement_0 = y_displacement_0[40:140]
y_displacement_1 = y_displacement_1[40:140]
y_displacement_2 = y_displacement_2[40:140]
y_displacement_0 *= -1
y_displacement_1 *= -1
y_displacement_2 *= -1

x_displacement_0 = subset_0_data.MODEL_DISPLACEMENT_X
x_displacement_1 = subset_1_data.MODEL_DISPLACEMENT_X
x_displacement_2 = subset_2_data.MODEL_DISPLACEMENT_X
x_displacement_0 = x_displacement_0[40:140]
x_displacement_1 = x_displacement_1[40:140]
x_displacement_2 = x_displacement_2[40:140]
x_displacement_0 *= -1
x_displacement_1 *= -1
x_displacement_2 *= -1
plt.title("Z Displacement")
plt.ylabel("Displacement (mm)")
plt.xlabel("Time (s)")
plt.grid()
plt.plot(z_displacement_0)
plt.plot(z_displacement_1)
plt.plot(z_displacement_2)
plt.title("Y Displacement")
plt.ylabel("Displacement (mm)")
plt.xlabel("Time (s)")
plt.grid()
plt.plot(y_displacement_0)
plt.plot(y_displacement_1)
plt.plot(y_displacement_2)
plt.title("X Displacement")
plt.ylabel("Displacement (mm)")
plt.xlabel("Time (s)")
plt.grid()
plt.plot(x_displacement_0)
plt.plot(x_displacement_1)
plt.plot(x_displacement_2)
mean = np.mean(z_displacement_0, axis=0)
sd = np.std(z_displacement_0, axis=0)
final_displacement_z_0 = [x for x in z_displacement_0 if (x > mean - 2 * sd)]
final_displacement_z_0 = [x for x in final_displacement_z_0 if (x < mean + 2 * sd)]
final_displacement_z_0 = pd.Series(final_displacement_z_0)

mean = np.mean(z_displacement_1, axis=0)
sd = np.std(z_displacement_1, axis=0)
final_displacement_z_1 = [x for x in z_displacement_1 if (x > mean - 2 * sd)]
final_displacement_z_1 = [x for x in final_displacement_z_1 if (x < mean + 2 * sd)]
final_displacement_z_1 = pd.Series(final_displacement_z_1)

mean = np.mean(z_displacement_2, axis=0)
sd = np.std(z_displacement_2, axis=0)
final_displacement_z_2 = [x for x in z_displacement_2 if (x > mean - 2 * sd)]
final_displacement_z_2 = [x for x in final_displacement_z_2 if (x < mean + 2 * sd)]
final_displacement_z_2 = pd.Series(final_displacement_z_2)


plt.plot(final_displacement_z_0)
plt.plot(final_displacement_z_1)
plt.plot(final_displacement_z_2)
mean = np.mean(y_displacement_0, axis=0)
sd = np.std(y_displacement_0, axis=0)
final_displacement_y_0 = [x for x in y_displacement_0 if (x > mean - 2 * sd)]
final_displacement_y_0 = [x for x in final_displacement_y_0 if (x < mean + 2 * sd)]
final_displacement_y_0 = pd.Series(final_displacement_y_0)

mean = np.mean(y_displacement_1, axis=0)
sd = np.std(y_displacement_1, axis=0)
final_displacement_y_1 = [x for x in y_displacement_1 if (x > mean - 2 * sd)]
final_displacement_y_1 = [x for x in final_displacement_y_1 if (x < mean + 2 * sd)]
final_displacement_y_1 = pd.Series(final_displacement_y_1)

mean = np.mean(y_displacement_2, axis=0)
sd = np.std(y_displacement_2, axis=0)
final_displacement_y_2 = [x for x in y_displacement_2 if (x > mean - 2 * sd)]
final_displacement_y_2 = [x for x in final_displacement_y_2 if (x < mean + 2 * sd)]
final_displacement_y_2 = pd.Series(final_displacement_y_2)


plt.plot(final_displacement_y_0)
plt.plot(final_displacement_y_1)
plt.plot(final_displacement_y_2)
mean = np.mean(x_displacement_0, axis=0)
sd = np.std(x_displacement_0, axis=0)
final_displacement_x_0 = [x for x in x_displacement_0 if (x > mean - 2 * sd)]
final_displacement_x_0 = [x for x in final_displacement_x_0 if (x < mean + 2 * sd)]
final_displacement_x_0 = pd.Series(final_displacement_x_0)

mean = np.mean(x_displacement_1, axis=0)
sd = np.std(x_displacement_1, axis=0)
final_displacement_x_1 = [x for x in x_displacement_1 if (x > mean - 2 * sd)]
final_displacement_x_1 = [x for x in final_displacement_x_1 if (x < mean + 2 * sd)]
final_displacement_x_1 = pd.Series(final_displacement_x_1)

mean = np.mean(x_displacement_2, axis=0)
sd = np.std(x_displacement_2, axis=0)
final_displacement_x_2 = [x for x in x_displacement_2 if (x > mean - 2 * sd)]
final_displacement_x_2 = [x for x in final_displacement_x_2 if (x < mean + 2 * sd)]
final_displacement_x_2 = pd.Series(final_displacement_x_2)


plt.plot(final_displacement_x_0)
plt.plot(final_displacement_x_1)
plt.plot(final_displacement_x_2)
steady_state_0 = final_displacement_z_0
steady_state_1 = final_displacement_z_1
steady_state_2 = final_displacement_z_2
plt.plot(steady_state_0)
plt.plot(steady_state_1)
plt.plot(steady_state_2)
z_val1 = np.sqrt(((steady_state_0 ** 2) .sum ()/steady_state_0.size))
z_val2 = np.sqrt(((steady_state_1 ** 2) .sum ()/steady_state_1.size))
z_val3 = np.sqrt(((steady_state_2 ** 2) .sum ()/steady_state_2.size))
print("Subset 1 RMS  : {} mm".format(round(z_val1,5)))
print("Subset 2 RMS  : {} mm".format(round(z_val2,5)))
print("Subset 3 RMS  : {} mm".format(round(z_val3,5)))
print ("Avg Z Axis RMS: {} mm".format(round(((z_val1+z_val2+z_val3)/3),5)))
steady_state_0 = final_displacement_y_0
steady_state_1 = final_displacement_y_1
steady_state_2 = final_displacement_y_2
plt.plot(steady_state_0)
plt.plot(steady_state_1)
plt.plot(steady_state_2)
y_val1 = np.sqrt(((steady_state_0 ** 2) .sum ()/steady_state_0.size))
y_val2 = np.sqrt(((steady_state_1 ** 2) .sum ()/steady_state_1.size))
y_val3 = np.sqrt(((steady_state_2 ** 2) .sum ()/steady_state_2.size))
print("Subset 1 RMS  : {} mm".format(round(y_val1,5)))
print("Subset 2 RMS  : {} mm".format(round(y_val2,5)))
print("Subset 3 RMS  : {} mm".format(round(y_val3,5)))
print ("Avg Y Axis RMS: {} mm".format(round(((y_val1+y_val2+y_val3)/3),5)))
steady_state_0 = final_displacement_x_0
steady_state_1 = final_displacement_x_1
steady_state_2 = final_displacement_x_2
plt.plot(steady_state_0)
plt.plot(steady_state_1)
plt.plot(steady_state_2)
x_val1 = np.sqrt(((steady_state_0 ** 2) .sum ()/steady_state_0.size))
x_val2 = np.sqrt(((steady_state_1 ** 2) .sum ()/steady_state_1.size))
x_val3 = np.sqrt(((steady_state_2 ** 2) .sum ()/steady_state_2.size))
print("Subset 1 RMS  : {} mm".format(round(x_val1,5)))
print("Subset 2 RMS  : {} mm".format(round(x_val2,5)))
print("Subset 3 RMS  : {} mm".format(round(x_val3,5)))
print ("Avg X Axis RMS: {} mm".format(round(((x_val1+x_val2+x_val3)/3),5)))<jupyter_output>Subset 1 RMS  : 0.0005 mm
Subset 2 RMS  : 0.00204 mm
Subset 3 RMS  : 0.00158 mm
Avg X Axis RMS: 0.00137 mm
{'fraction_non_alphanumeric': 0.1265186426476749, 'fraction_numerical': 0.05069124423963134, 'mean_word_length': 6.948945615982242, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '102987', 'license': 'MIT', 'n_tokens_mistral': 3159, 'n_tokens_neox': 3014, 'n_words': 535, 'path': 'Noise/Noise_Floor_Sync_2/ResultsAnalysis.ipynb', 'repo_name': 'haemishkyd/kydhae001_msc_results', 'size': '7161'}