Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move qc features into dedicated library #160

Merged
merged 28 commits into from
Sep 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improving qc
Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
gwbres committed Sep 5, 2023
commit 51ace4360ea2a7ae320de7dc48e1a0170cd992cb
2 changes: 0 additions & 2 deletions rinex-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -471,8 +471,6 @@ pub fn main() -> Result<(), rinex::Error> {
*/
if qc {
info!("entering qc mode");
let mut qc_opts = cli.qc_config();

/*
* QC Config / versus command line
* let the possibility to define some parameters
1 change: 1 addition & 0 deletions rinex/src/algorithm/derivative.rs
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ impl Derivative {
Self { order }
}
pub fn eval<T: std::ops::Sub<Output = T> + std::marker::Copy>(
&self,
input: Vec<(Epoch, T)>,
) -> Vec<(Epoch, T)> {
let mut buf: Vec<(Epoch, T)> = Vec::with_capacity(input.len());
1 change: 1 addition & 0 deletions rinex/src/algorithm/mod.rs
Original file line number Diff line number Diff line change
@@ -11,3 +11,4 @@ pub use filters::{
};

pub use averaging::Averager;
pub use derivative::Derivative;
51 changes: 42 additions & 9 deletions rinex/src/qc/analysis/obs.rs
Original file line number Diff line number Diff line change
@@ -31,6 +31,34 @@ fn report_signals(list: &Vec<Carrier>) -> String {
s
}

/*
* Report RX Clock drift analysis
*/
fn report_clock_drift(data: &Vec<(Epoch, f64)>) -> Box<dyn RenderBox + '_> {
box_html! {
table(class="table is-bordered") {
tr {
th {
: "Epoch"
}
th {
: "Mean Clock drift [s/s]"
}
}
@ for (epoch, drift) in data {
tr {
td {
: epoch.to_string()
}
td {
: format!("{:e}", drift)
}
}
}
}
}
}

/*
* Epoch anomalies formatter
*/
@@ -309,14 +337,6 @@ fn report_ssi_statistics(
}
}

fn derivative_dt(data: Vec<(Epoch, f64)>) -> Vec<(Epoch, f64)> {
let mut acc = 0.0_f64;
let mut prev_epoch: Option<Epoch> = None;
let mut ret: Vec<(Epoch, f64)> = Vec::new();
for (epoch, value) in data {}
ret
}

#[derive(Debug, Clone)]
/// OBS RINEX specific QC analysis.
/// Full OBS RINEX analysis requires both the "obs" and "processing" features.
@@ -570,7 +590,8 @@ impl QcObsAnalysis {
.recvr_clock()
.map(|((e, flag), value)| (e, value))
.collect();
let rx_clock_drift: Vec<(Epoch, f64)> = derivative_dt(rx_clock);
let der = Derivative::new(1);
let rx_clock_drift: Vec<(Epoch, f64)> = der.eval(rx_clock);
let mov = Averager::mov(opts.clock_drift_window);
mov.eval(rx_clock_drift)
},
@@ -647,6 +668,18 @@ impl HtmlReport for QcObsAnalysis {
}
}
}
tr {
table {
thead {
th {
: "(RX) Clock Drift"
}
}
tbody {
: report_clock_drift(&self.clock_drift)
}
}
}
}
}
}