diff --git a/crx2rnx/Cargo.toml b/crx2rnx/Cargo.toml index 1ada87eb4..540c0da44 100644 --- a/crx2rnx/Cargo.toml +++ b/crx2rnx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crx2rnx" -version = "2.3.1" +version = "2.3.2" license = "MIT OR Apache-2.0" authors = ["Guillaume W. Bres "] description = "RINEX data decompressor" @@ -12,4 +12,4 @@ readme = "README.md" [dependencies] clap = { version = "4.4.13", features = ["derive", "color"] } -rinex = { path = "../rinex", version = "=0.15.6", features = ["serde"] } +rinex = { path = "../rinex", version = "=0.15.7", features = ["serde"] } diff --git a/rinex-cli/Cargo.toml b/rinex-cli/Cargo.toml index 13d74fb7b..c2a8de06b 100644 --- a/rinex-cli/Cargo.toml +++ b/rinex-cli/Cargo.toml @@ -32,9 +32,9 @@ horrorshow = "0.8" clap = { version = "4.4.13", features = ["derive", "color"] } hifitime = { version = "3.9.0", features = ["serde", "std"] } gnss-rs = { version = "2.1.3" , features = ["serde"] } -rinex = { path = "../rinex", version = "=0.15.6", features = ["full"] } -rinex-qc = { path = "../rinex-qc", version = "=0.1.11", features = ["serde"] } -sp3 = { path = "../sp3", version = "=1.0.7", features = ["serde", "flate2"] } +rinex = { path = "../rinex", version = "=0.15.7", features = ["full"] } +rinex-qc = { path = "../rinex-qc", version = "=0.1.12", features = ["serde"] } +sp3 = { path = "../sp3", version = "=1.0.8", features = ["serde", "flate2"] } serde = { version = "1.0", default-features = false, features = ["derive"] } # plotly @@ -42,7 +42,7 @@ plotly = "0.8.4" # plotly = { git = "https://github.com/gwbres/plotly", branch = "density-mapbox" } # solver -gnss-rtk = { version = "0.4.2", features = ["serde"] } +gnss-rtk = { version = "0.4.3", features = ["serde"] } # gnss-rtk = { path = "../../rtk-rs/gnss-rtk", features = ["serde"] } # cggtts diff --git a/rinex-cli/src/graph/record/navigation.rs b/rinex-cli/src/graph/record/navigation.rs index b992ac614..6ff8e80ce 100644 --- a/rinex-cli/src/graph/record/navigation.rs +++ b/rinex-cli/src/graph/record/navigation.rs @@ -192,7 +192,7 @@ fn ctx_sv_clock_corrections( obs: &Rinex, nav: &Rinex, clk: Option<&Rinex>, - _sp3: Option<&SP3>, + sp3: Option<&SP3>, ) -> CtxClockCorrections { let mut clock_corr = CtxClockCorrections::new(); for ((t, flag), (_, vehicles)) in obs.observation() { @@ -215,8 +215,15 @@ fn ctx_sv_clock_corrections( let clock_state: Option<(f64, f64, f64)> = match product { ProductType::Radio => Some(sv_eph.sv_clock()), ProductType::HighPrecisionSp3 => { - //TODO: sv_clock interpolate please - None + if let Some(sp3) = sp3 { + if let Some(bias) = sp3.sv_clock_interpolate(*t, *sv) { + Some((bias, 0.0_f64, 0.0_f64)) + } else { + None + } + } else { + None + } }, ProductType::HighPrecisionClk => { if let Some(clk) = clk { @@ -233,13 +240,6 @@ fn ctx_sv_clock_corrections( } }) .reduce(|k, _| k) - //if let Some((_, profile)) = clk - // .precise_sv_clock_interpolate(*t, *sv) - //{ - // Some((profile.bias, profile.drift.unwrap_or(0.0_f64), profile.drift_change.unwrap_or(0.0_f64))) - //} else { - // None - //} } else { None } diff --git a/rinex-qc/Cargo.toml b/rinex-qc/Cargo.toml index d6bf36797..386c2de1e 100644 --- a/rinex-qc/Cargo.toml +++ b/rinex-qc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rinex-qc" -version = "0.1.11" +version = "0.1.12" license = "MIT OR Apache-2.0" authors = ["Guillaume W. Bres "] description = "RINEX data analysis" @@ -26,9 +26,9 @@ strum_macros = "0.26" horrorshow = "0.8" itertools = "0.12.0" statrs = "0.16" -sp3 = { path = "../sp3", version = "=1.0.7", features = ["serde"] } +sp3 = { path = "../sp3", version = "=1.0.8", features = ["serde"] } rinex-qc-traits = { path = "../qc-traits", version = "=0.1.1" } -rinex = { path = "../rinex", version = "=0.15.6", features = ["full"] } +rinex = { path = "../rinex", version = "=0.15.7", features = ["full"] } gnss-rs = { version = "2.1.3", features = ["serde"] } [dev-dependencies] diff --git a/rinex/Cargo.toml b/rinex/Cargo.toml index 29f48fa2b..f96436de0 100644 --- a/rinex/Cargo.toml +++ b/rinex/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rinex" -version = "0.15.6" +version = "0.15.7" license = "MIT OR Apache-2.0" authors = ["Guillaume W. Bres "] description = "Package to parse and analyze RINEX data" @@ -101,7 +101,7 @@ rinex-qc-traits = { path = "../qc-traits", version = "=0.1.1", optional = true } # RINEX Context dependencies walkdir = { version = "2.4.0", optional = true } -sp3 = { path = "../sp3", version = "=1.0.7", optional = true } +sp3 = { path = "../sp3", version = "=1.0.8", optional = true } [dev-dependencies] serde_json = "1" diff --git a/rnx2crx/Cargo.toml b/rnx2crx/Cargo.toml index ea89ac42e..d63d0cf2b 100644 --- a/rnx2crx/Cargo.toml +++ b/rnx2crx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rnx2crx" -version = "1.2.1" +version = "1.2.2" license = "MIT OR Apache-2.0" authors = ["Guillaume W. Bres "] description = "RINEX data compressor" @@ -14,4 +14,4 @@ readme = "README.md" [dependencies] thiserror = "1" clap = { version = "4.4.13", features = ["derive", "color"] } -rinex = { path = "../rinex", version = "=0.15.6", features = ["serde"] } +rinex = { path = "../rinex", version = "=0.15.7", features = ["serde"] } diff --git a/sp3/Cargo.toml b/sp3/Cargo.toml index 8ad4e8859..cb7eb68ca 100644 --- a/sp3/Cargo.toml +++ b/sp3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sp3" -version = "1.0.7" +version = "1.0.8" license = "MIT OR Apache-2.0" authors = ["Guillaume W. Bres "] description = "IGS SP3 file parser" diff --git a/sp3/src/lib.rs b/sp3/src/lib.rs index cb6f94477..375dd620a 100644 --- a/sp3/src/lib.rs +++ b/sp3/src/lib.rs @@ -183,7 +183,7 @@ pub struct SP3 { pub sv: Vec, /// Positions expressed in km, with 1mm precision, per Epoch and SV. pub position: PositionRecord, - /// Clock estimates in microseconds, with 1E-12 precision per Epoch and SV. + /// Clock offsets with 1E-12 precision per Epoch and SV. pub clock: ClockRecord, /// Velocities (Position derivative estimates) in 10^-1 m/s with 0.1 um/s precision. pub velocities: VelocityRecord, @@ -518,8 +518,7 @@ impl SP3 { .iter() .flat_map(|(e, sv)| sv.iter().map(|(sv, vel)| (*e, *sv, *vel))) } - /// Returns an Iterator over Clock error estimates, in microseconds - /// with 1E-12 precision. + /// Returns an Iterator over Clock offsets with theoretical 1E-12 precision. pub fn sv_clock(&self) -> impl Iterator + '_ { self.clock .iter() @@ -532,7 +531,7 @@ impl SP3 { .iter() .flat_map(|(e, sv)| sv.iter().map(|(sv, clk)| (*e, *sv, *clk))) } - /// Interpolate Clock state at desired "t" expressed in the timescale you want. + /// Interpolate Clock (offset) at desired "t" expressed in the timescale you want. /// SP3 files usually have a 15' sampling interval which makes this operation /// most likely incorrect. You should either use higher sample rate to reduce /// the error generated by interpolation, or use different products like diff --git a/sp3/src/position.rs b/sp3/src/position.rs index eeef37fbe..1e0c51841 100644 --- a/sp3/src/position.rs +++ b/sp3/src/position.rs @@ -40,7 +40,7 @@ impl std::str::FromStr for PositionEntry { */ let clk_data = f64::from_str(line[46..60].trim()) .or(Err(ParsingError::Clock(line[46..60].to_string())))?; - clock = Some(clk_data); + clock = Some(clk_data * 1.0E-6); } Ok(Self { sv, diff --git a/sp3/src/tests/parser_3d.rs b/sp3/src/tests/parser_3d.rs index 0344e6778..183a3df2f 100644 --- a/sp3/src/tests/parser_3d.rs +++ b/sp3/src/tests/parser_3d.rs @@ -82,15 +82,15 @@ mod test { for (epoch, sv, clock) in sp3.sv_clock() { assert_eq!(epoch, Epoch::from_str("2019-10-27T00:00:00 GPST").unwrap()); if sv == sv!("C01") { - assert_eq!(clock, 63.035497, "bad clock data"); + assert!((clock - 63.035497E-6).abs() < 1E-9, "bad clock data"); } else if sv == sv!("E01") { - assert_eq!(clock, -718.927492, "bad clock data"); + assert!((clock - -718.927492E-6).abs() < 1E-9, "bad clock data"); } else if sv == sv!("G01") { - assert_eq!(clock, -176.397152, "bad clock data"); + assert!((clock - -176.397152E-6).abs() < 1E-9, "bad clock data"); } else if sv == sv!("J01") { - assert_eq!(clock, -336.145158, "bad clock data"); + assert!((clock - -336.145158E-6).abs() < 1E-9, "bad clock data"); } else if sv == sv!("R01") { - assert_eq!(clock, 51.759894, "bad clock data"); + assert!((clock - 51.759894E-6).abs() < 1E-9, "bad clock data"); } else { panic!("identified wrong sv"); } diff --git a/ublox-rnx/Cargo.toml b/ublox-rnx/Cargo.toml index 72c3baeef..3485cf37f 100644 --- a/ublox-rnx/Cargo.toml +++ b/ublox-rnx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ublox-rnx" -version = "0.1.5" +version = "0.1.6" license = "MIT OR Apache-2.0" authors = ["Guillaume W. Bres "] description = "Efficient RINEX production from a Ublox GNSS receiver" @@ -22,4 +22,4 @@ serialport = "4.2.0" ublox = "0.4.4" clap = { version = "4.4.10", features = ["derive", "color"] } gnss-rs = { version = "2.1.3", features = ["serde"] } -rinex = { path = "../rinex", version = "=0.15.6", features = ["serde", "nav", "obs"] } +rinex = { path = "../rinex", version = "=0.15.7", features = ["serde", "nav", "obs"] }