Calibration Aftermath #131
@ -514,8 +514,6 @@ def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
for entry in zip(print_str_list, formatted_list):
|
for entry in zip(print_str_list, formatted_list):
|
||||||
pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
|
pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
|
||||||
current_idx += 1
|
current_idx += 1
|
||||||
if PERFORM_MGM_CALIBRATION:
|
|
||||||
perform_mgm_calibration(pw, mgm_0_lis3_floats_ut)
|
|
||||||
assert current_idx == 61
|
assert current_idx == 61
|
||||||
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=6)
|
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=6)
|
||||||
|
|
||||||
@ -528,12 +526,27 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
pw.dlog("Recieved HK set too small")
|
pw.dlog("Recieved HK set too small")
|
||||||
return
|
return
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
for i in range(5):
|
|
||||||
fmt_str = "!fff"
|
fmt_str = "!fff"
|
||||||
inc_len = struct.calcsize(fmt_str)
|
inc_len = struct.calcsize(fmt_str)
|
||||||
mgm_vec = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len])
|
mgm_0 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len])
|
||||||
mgm_vec = [f"{val:8.3f}" for val in mgm_vec]
|
mgm_0_str = [f"{val:8.3f}" for val in mgm_0]
|
||||||
pw.dlog(f"MGM {i}: {mgm_vec}")
|
pw.dlog(f"MGM 0 Vec: {mgm_0_str}")
|
||||||
|
current_idx += inc_len
|
||||||
|
mgm_1 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len])
|
||||||
|
mgm_1_str = [f"{val:8.3f}" for val in mgm_1]
|
||||||
|
pw.dlog(f"MGM 1 Vec: {mgm_1_str}")
|
||||||
|
current_idx += inc_len
|
||||||
|
mgm_2 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len])
|
||||||
|
mgm_2_str = [f"{val:8.3f}" for val in mgm_2]
|
||||||
|
pw.dlog(f"MGM 2 Vec: {mgm_2_str}")
|
||||||
|
current_idx += inc_len
|
||||||
|
mgm_3 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len])
|
||||||
|
mgm_3_str = [f"{val:8.3f}" for val in mgm_3]
|
||||||
|
pw.dlog(f"MGM 3 Vec: {mgm_3_str}")
|
||||||
|
current_idx += inc_len
|
||||||
|
mgm_4 = struct.unpack(fmt_str, hk_data[current_idx: current_idx + inc_len])
|
||||||
|
mgm_4_str = [f"{val:8.3f}" for val in mgm_4]
|
||||||
|
pw.dlog(f"MGM 4 Vec: {mgm_4_str}")
|
||||||
current_idx += inc_len
|
current_idx += inc_len
|
||||||
fmt_str = "!ddd"
|
fmt_str = "!ddd"
|
||||||
inc_len = struct.calcsize(fmt_str)
|
inc_len = struct.calcsize(fmt_str)
|
||||||
@ -553,6 +566,8 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
mag_igrf_model = [f"{val:8.3f}" for val in mag_igrf_model]
|
mag_igrf_model = [f"{val:8.3f}" for val in mag_igrf_model]
|
||||||
pw.dlog(f"MAG IGRF Model: {mag_igrf_model}")
|
pw.dlog(f"MAG IGRF Model: {mag_igrf_model}")
|
||||||
current_idx += inc_len
|
current_idx += inc_len
|
||||||
|
if PERFORM_MGM_CALIBRATION:
|
||||||
|
perform_mgm_calibration(pw, mgm_3)
|
||||||
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=8)
|
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=8)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user