                                          std=np.sqrt(P_diag[GStates.ECEF_POS]).tolist(),
                                          valid=kf_valid),
          "kalmanVelocityECEF": measurement_msg(value=self.gnss_kf.x[GStates.ECEF_VELOCITY].tolist(),
                                          std=np.sqrt(P_diag[GStates.ECEF_VELOCITY]).tolist(),
                                          valid=kf_valid),
          "positionECEF": measurement_msg(value=position_estimate, std=position_std.tolist(), valid=bool(self.last_fix_t == t)),
          "velocityECEF": measurement_msg(value=velocity_estimate, std=velocity_std.tolist(), valid=bool(self.last_fix_t == t)),
  
          "measTime": gnss_mono_time,
          "correctedMeasurements": meas_msgs,
          "timeToFirstFix": self.ttff,
          "ephemerisStatuses": self.create_ephem_statuses(),
        }
      return out_msg
  
    def update_localizer(self, est_pos, t: float, measurements: List[GNSSMeasurement]):
      # Check time and outputs are valid
      valid = self.kf_valid(t)
 
</s> remove                                         valid=kf_valid),
        "kalmanVelocityECEF": measurement_msg(value=self.gnss_kf.x[GStates.ECEF_VELOCITY].tolist(),
 </s> add                                         valid=kf_valid)
      msg_dict["kalmanVelocityECEF"] = measurement_msg(value=self.gnss_kf.x[GStates.ECEF_VELOCITY].tolist(), </s> remove       out_msg.gnssMeasurements = {
        "gpsWeek": week,
        "gpsTimeOfWeek": tow,
        "kalmanPositionECEF": measurement_msg(value=self.gnss_kf.x[GStates.ECEF_POS].tolist(),
 </s> add       msg_dict["kalmanPositionECEF"] = measurement_msg(value=self.gnss_kf.x[GStates.ECEF_POS].tolist(), </s> remove       corrected_measurements = []
      instant_fix = self.get_lsq_fix(t, processed_measurements)
 </s> add       est_pos = self.gnss_kf.x[GStates.ECEF_POS].tolist()
    corrected_measurements = correct_measurements(processed_measurements, est_pos, self.astro_dog)
    return corrected_measurements

  def calc_fix(self, t, measurements):
    instant_fix = self.get_lsq_fix(t, measurements) </s> remove     self.assertEqual(375, len(correct_msgs))
    self.assertEqual(375, len([m for m in correct_msgs if m.gnssMeasurements.positionECEF.valid]))
 </s> add     expected_msgs = 376
    self.assertEqual(expected_msgs, len(correct_msgs))
    self.assertEqual(expected_msgs, len([m for m in correct_msgs if m.gnssMeasurements.positionECEF.valid])) </s> remove       corrected_measurements = correct_measurements(processed_measurements, self.last_fix_pos, self.astro_dog)
      instant_fix = self.get_lsq_fix(t, corrected_measurements)
      #instant_fix = self.get_lsq_fix(t, processed_measurements)
 </s> add       est_pos = self.last_fix_pos
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                          std=np.sqrt(P_diag[GStates.ECEF_POS]).tolist(),
                                          valid=kf_valid),
          "kalmanVelocityECEF": measurement_msg(value=self.gnss_kf.x[GStates.ECEF_VELOCITY].tolist(),
                                          std=np.sqrt(P_diag[GStates.ECEF_VELOCITY]).tolist(),
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
                                        valid=kf_valid)

    msg_dict['gpsWeek'] = self.last_report_time.week
    msg_dict['gpsTimeOfWeek'] = self.last_report_time.tow
    msg_dict['timeToFirstFix'] = self.ttff
    msg_dict['ephemerisStatuses'] = self.create_ephem_statuses()
    out_msg.gnssMeasurements = msg_dict
      return out_msg
  
    def update_localizer(self, est_pos, t: float, measurements: List[GNSSMeasurement]):
      # Check time and outputs are valid
      valid = self.kf_valid(t)
keep keep keep keep replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Laika cleaner flow (#27633)

* laika flow

* test fixes

* unexpected type

* unexpected type

* explicit type

* ref commit

* back to prev val

* ref 2 
selfdrive/locationd/laikad.py