Skip to content

Commit 70d23c0

Browse files
authored
Update to latest libs (#348)
* GnssAbsoluteTime upgrade * Header: round timestamps to 1e-6 Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent 4941c9c commit 70d23c0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/processing/timeshift.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use crate::{
22
observation::{ObsKey, Observations},
3-
prelude::{Header, Rinex, TimeScale},
3+
prelude::{Duration, Header, Rinex, TimeScale},
44
};
5-
65
use qc_traits::{GnssAbsoluteTime, Timeshift};
76

87
use std::collections::BTreeMap;
@@ -20,16 +19,16 @@ impl Timeshift for Header {
2019
fn timeshift_mut(&mut self, solver: &GnssAbsoluteTime, target: TimeScale) {
2120
if let Some(obs) = &mut self.obs {
2221
if let Some(epoch) = &mut obs.timeof_first_obs {
23-
if let Some(converted) = solver.epoch_time_correction(*epoch, target) {
24-
*epoch = converted;
22+
if let Some(converted) = solver.precise_epoch_correction(*epoch, target) {
23+
*epoch = converted.round(Duration::from_microseconds(1.0));
2524
} else {
2625
obs.timeof_first_obs = None;
2726
}
2827
}
2928

3029
if let Some(epoch) = &mut obs.timeof_last_obs {
31-
if let Some(converted) = solver.epoch_time_correction(*epoch, target) {
32-
*epoch = converted;
30+
if let Some(converted) = solver.precise_epoch_correction(*epoch, target) {
31+
*epoch = converted.round(Duration::from_microseconds(1.0));
3332
} else {
3433
obs.timeof_last_obs = None;
3534
}
@@ -55,7 +54,7 @@ impl Timeshift for Rinex {
5554
let mut new_rec = BTreeMap::<ObsKey, Observations>::new();
5655

5756
for (k, values) in obs_rec.iter() {
58-
if let Some(converted) = solver.epoch_time_correction(k.epoch, target) {
57+
if let Some(converted) = solver.precise_epoch_correction(k.epoch, target) {
5958
let mut key = k.clone();
6059
key.epoch = converted;
6160

0 commit comments

Comments
 (0)