fixed loading CSV trafo matrix

This commit is contained in:
2023-01-26 11:54:00 +01:00
parent e107d15cf5
commit c678332b45
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -531,7 +531,7 @@ class MagnetometerCalibrationComplete(Thread):
matrix_trans_mgm_to_hh_np = np.zeros((3, 3))
for row in range(3):
for col in range(3):
matrix_trans_mgm_to_hh_np[row][col] = matrix_trans_mgm_to_hh_tk[row][col].get()
matrix_trans_mgm_to_hh_np[row][col] = matrix_trans_mgm_to_hh_tk[row][col]
# matrix_trans_mgm_to_hh_np = [[-1, 0, 0], [0, 1, 0], [0, 0, -1]] # hardcoded for MGM 1 / 3
# matrix_trans_mgm_to_hh_np = [[0, 1, 0], [-1, 0, 0], [0, 0, 1]] # hardcoded for MGM 0 / 2
ui_print("Applying transformation matrix to data. h_{set,mgm} = mgm_T_hh * h_{set,hh}")
+6 -3
View File
@@ -578,8 +578,8 @@ class CalibrateAmbientField(Frame):
self.controller = controller
# To center window
# self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
#self.columnconfigure(0, weight=1)
#self.rowconfigure(0, weight=1)
self.left_column = Frame(self)
self.left_column.grid(row=0, column=0, sticky="nsew")
self.right_column = Frame(self)
@@ -1824,9 +1824,12 @@ class CalibrateMagnetometerComplete(Frame):
return
self.calibration_raw_results = raw_data
# Note: Imported data must already have the MGM and set field aligned!
ui_print('Imported data transformed with unity matrix. Make sure, MGM and set field of file are in same COS!')
mgm_to_helmholtz_cos_trans = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
# Execute calibration function and display results
sensor_parameters, mag_x_set, mag_y_set, mag_z_set, mag_x_m, mag_y_m, mag_z_m, cal_x, cal_y, cal_z, mag_amp_avg_set = MagnetometerCalibrationComplete.solve_system(
raw_data, self.mgm_to_helmholtz_cos_trans)
raw_data, mgm_to_helmholtz_cos_trans)
MagnetometerCalibrationComplete.plot_magnetometer_calibration(self.right_column, mag_x_set, mag_y_set, mag_z_set,
mag_x_m,
mag_y_m, mag_z_m, cal_x, cal_y,