from construct import Struct, Int8ub, Int16ub, Int16sb, Int32ub, Int32sb format = Struct( "beacon_id" / Int8ub, "time" / Int32sb, "antenna" / Int8ub, "EPS" / Struct( "vboost(0)" / Int16ub, "vboost(1)" / Int16ub, "vboost(2)" / Int16ub, "vbatt" / Int16ub, "curout(0)" / Int16ub, "curout(1)" / Int16ub, "curout(2)" / Int16ub, "curout(3)" / Int16ub, "curout(4)" / Int16ub, "curout(5)" / Int16ub, "curin(0)" / Int16ub, "curin(1)" / Int16ub, "curin(2)" / Int16ub, "cursun" / Int16ub, "cursys" / Int16ub, "counter_wdt_gnd" / Int16ub, "counter_boot" / Int16ub, "temp(0)" / Int16ub, "temp(1)" / Int16ub, "temp(2)" / Int16ub, "temp(3)" / Int16ub, "counter_wdt_i2c" / Int32ub, "wdt_gnd_time_left" / Int32ub, "output(0)" / Int8ub, "output(1)" / Int8ub, "output(2)" / Int8ub, "output(3)" / Int8ub, "output(4)" / Int8ub, "output(5)" / Int8ub, "output(6)" / Int8ub, "output(7)" / Int8ub, "batt_mode" / Int8ub, "boot_cause" / Int8ub, "ppt_mode" / Int8ub, ), "RADIO" / Struct( "inst_rf_reflected" / Int16ub, "inst_rf_forward" / Int16ub, "supply_voltage_last" / Int16ub, "total_current_last" / Int16ub, "tx_current_last" / Int16ub, "rx_current_last" / Int16ub, "power_amp_current_last" / Int16ub, "temp_power_amp_last" / Int16ub, "temp_oscillator_last" / Int16ub, "inst_doppler_offset" / Int16ub, "inst_signal_strength" / Int16ub, "supply_voltage" / Int16ub, "total_current" / Int16ub, "tx_current" / Int16ub, "rx_current" / Int16ub, "power_amp_current" / Int16ub, "temp_power_amp" / Int16ub, "temp_oscillator" / Int16ub, "last_error" / Int8ub, ), "ram_in_use" / Int8ub, "disk_in_use" / Int8ub, "ADCS" / Struct( "est_roll_ang" / Int16sb, "est_pitch_ang" / Int16sb, "est_yaw_ang" / Int16sb, "est_q1" / Int16sb, "est_q2" / Int16sb, "est_q3" / Int16sb, "est_x_ang_rate" / Int16sb, "est_y_ang_rate" / Int16sb, "est_z_ang_rate" / Int16sb, "x_pos_eci" / Int16sb, "y_pos_eci" / Int16sb, "z_pos_eci" / Int16sb, "x_vel_eci" / Int16sb, "y_vel_eci" / Int16sb, "z_vel_eci" / Int16sb, "latitude" / Int16sb, "longitude" / Int16sb, "altitude" / Int16sb, "x_pos_ecef" / Int16sb, "y_pos_ecef" / Int16sb, "z_pos_ecef" / Int16sb, "estim_mode_select" / Int8ub, "con_mode_select" / Int8ub, "adcs_run_mode" / Int8ub, "asgp4_mode_select" / Int8ub, "mag_mode_val" / Int8ub, "cube_ctl_signal_enabled" / Int8ub, "cube_ctl_motor_enabled" / Int8ub, "cube_sense_1_enabled" / Int8ub, "cube_sense_2_enabled" / Int8ub, "cube_wheel_1_enabled" / Int8ub, "cube_wheel_2_enabled" / Int8ub, "cube_wheel_3_enabled" / Int8ub, "cube_star_enabled" / Int8ub, "gps_reciever_enabled" / Int8ub, "gps_lna_pwr_enabled" / Int8ub, "motor_driver_enabled" / Int8ub, "sun_above_local_horiz" / Int8ub, "cube_sense_1_com_err" / Int8ub, "cube_sense_2_com_err" / Int8ub, "cube_ctl_signal_com_err" / Int8ub, "cube_ctl_motor_com_err" / Int8ub, "cube_wheel_1_com_err" / Int8ub, "cube_wheel_2_com_err" / Int8ub, "cube_wheel_3_com_err" / Int8ub, "cube_star_com_err" / Int8ub, "magnetometer_range_err" / Int8ub, "cam1_sram_overcurrent" / Int8ub, "cam1_3v3_overcurrent" / Int8ub, "cam1_sensor_busy_err" / Int8ub, "cam1_sensor_detection_err" / Int8ub, "sun_sensor_range_err" / Int8ub, "cam2_sram_overcurrent" / Int8ub, "cam2_3v3_overcurrent" / Int8ub, "cam2_sensor_busy_err" / Int8ub, "cam2_sensor_detection_err" / Int8ub, "nadir_sensor_range_err" / Int8ub, "rate_sensor_range_err" / Int8ub, "wheel_speed_range_err" / Int8ub, "coarse_sun_sensor_err" / Int8ub, "star_tracker_match_err" / Int8ub, "star_tracker_overcurrent" / Int8ub, "orbit_params_invalid" / Int8ub, "config_invalid" / Int8ub, "control_mode_change_disallowed" / Int8ub, "estimator_change_disallowed" / Int8ub, "model_measured_mag_size_diff" / Int8ub, "node_recovery_error" / Int8ub, "cube_sense_1_runtime_err" / Int8ub, "cube_sense_2_runtime_err" / Int8ub, "cube_ctl_signal_runtime_err" / Int8ub, "cube_ctl_motor_runtime_err" / Int8ub, "cube_wheel_1_runtime_err" / Int8ub, "cube_wheel_2_runtime_err" / Int8ub, "cube_wheel_3_runtime_err" / Int8ub, "cube_star_runtime_err" / Int8ub, "magnetometer_err" / Int8ub, "rate_sensor_failure" / Int8ub, ), "RAD" / Struct( "rc-1" / Int16sb, "rc-2" / Int16sb, "rc-3" / Int16sb, "rc-4" / Int16sb, "rc-5" / Int16sb, "pdb-1" / Int16sb, "pdb-2" / Int16sb, "pdb-3" / Int16sb, "pdb-4" / Int16sb, "pdb-5" / Int16sb ) )