1
1
use crate :: {
2
2
observation:: { ObsKey , Observations } ,
3
- prelude:: { Header , Rinex , TimeScale } ,
3
+ prelude:: { Duration , Header , Rinex , TimeScale } ,
4
4
} ;
5
-
6
5
use qc_traits:: { GnssAbsoluteTime , Timeshift } ;
7
6
8
7
use std:: collections:: BTreeMap ;
@@ -20,16 +19,16 @@ impl Timeshift for Header {
20
19
fn timeshift_mut ( & mut self , solver : & GnssAbsoluteTime , target : TimeScale ) {
21
20
if let Some ( obs) = & mut self . obs {
22
21
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 ) ) ;
25
24
} else {
26
25
obs. timeof_first_obs = None ;
27
26
}
28
27
}
29
28
30
29
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 ) ) ;
33
32
} else {
34
33
obs. timeof_last_obs = None ;
35
34
}
@@ -55,7 +54,7 @@ impl Timeshift for Rinex {
55
54
let mut new_rec = BTreeMap :: < ObsKey , Observations > :: new ( ) ;
56
55
57
56
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) {
59
58
let mut key = k. clone ( ) ;
60
59
key. epoch = converted;
61
60
0 commit comments