Skip to content

Commit

Permalink
Allow creating array from uncorrected measurements (#104)
Browse files Browse the repository at this point in the history
Create array from uncorrected measurement
  • Loading branch information
gijskoning authored Jul 6, 2022
1 parent 6e87f53 commit 3f139a0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions laika/raw_gnss.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,19 @@ def correct(self, est_pos, dog):
return True
return False

def as_array(self):
def as_array(self, only_corrected=True):
observables = self.observables_final
sat_pos = self.sat_pos_final
if not self.corrected:
raise NotImplementedError('Only corrected measurements can be put into arrays')
if only_corrected:
raise NotImplementedError('Only corrected measurements can be put into arrays')
else:
observables = self.observables
sat_pos = self.sat_pos
ret = np.array([self.get_nmea_id(), self.recv_time_week, self.recv_time_sec, self.glonass_freq,
self.observables_final['C1C'], self.observables_std['C1C'],
self.observables_final['D1C'], self.observables_std['D1C']])
return np.concatenate((ret, self.sat_pos_final, self.sat_vel))
observables['C1C'], self.observables_std['C1C'],
observables['D1C'], self.observables_std['D1C']])
return np.concatenate((ret, sat_pos, self.sat_vel))

def __repr__(self):
time = self.recv_time.as_datetime().strftime('%Y-%m-%dT%H:%M:%S.%f')
Expand Down

0 comments on commit 3f139a0

Please sign in to comment.