forked from georust/rinex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SBAS and BRDC Navigation Improved QC capabilities and reporting features Integrated plot Breaking changes in the command line opts Breaking changes: Graph mode is removed and integrated into analysis mode --------- Signed-off-by: Guillaume W. Bres <[email protected]>
- Loading branch information
Showing
212 changed files
with
11,314 additions
and
7,858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ Cargo.lock | |
*.swp | ||
*.swo | ||
*.patch | ||
*.txt | ||
**/*.rs.bk | ||
.DS_Store | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# RINEX/GNSS QC and processing | ||
|
||
This crate is a small library to share and implement in other libraries | ||
to form a coherent ecosystem to process and analyze GNSS data. | ||
|
||
As an example, this crate is implemented in the RINEX and SP3 libraries, the RINEX-QC | ||
library and the RINEX-Cli application and allows the synthesis of analysis reports | ||
and the processing on GNSS down to navigation. | ||
|
||
## Existing Modules | ||
|
||
- html: HTML report rendition | ||
- merge: describes how we stack data into an already existing context | ||
- processing: available on crate feature only, | ||
describes a filter designer and processing ops |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
//! Specific traits to generate RINEX quality reports. | ||
#![doc(html_logo_url = "https://raw.githubusercontent.com/georust/meta/master/logo/logo.png")] | ||
#![doc = include_str!("../README.md")] | ||
#![cfg_attr(docrs, feature(doc_cfg))] | ||
|
||
mod html; | ||
pub use html::HtmlReport; | ||
pub mod merge; | ||
pub use merge::{Error as MergeError, Merge}; | ||
|
||
#[cfg(feature = "processing")] | ||
#[cfg_attr(docrs, doc(cfg(feature = "processing")))] | ||
pub mod processing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//! Merge traits to extend data contexts | ||
use thiserror::Error; | ||
|
||
/// [Merge] specific Errors. | ||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
/// When merging B into A, both types should match | ||
/// otherwise operation in invalid. | ||
#[error("file type mismatch")] | ||
FileTypeMismatch, | ||
/// Some file formats, to remain valid, require that | ||
/// B and A be expressed in the same Timescale to remain valid | ||
#[error("timescale mismatch")] | ||
TimescaleMismatch, | ||
/// Some file formats, to remain valid, require that coordinates | ||
/// from B and A be expressed in the same Reference Frame to remain valid | ||
#[error("reference frame mismatch")] | ||
ReferenceFrameMismatch, | ||
/// Some file formats, to remain valid, require that they are | ||
/// published by the same publisher/agency to be merged to into one another | ||
#[error("data provider (agency) mismatch")] | ||
DataProviderAgencyMismatch, | ||
} | ||
|
||
/// Merge Trait is impleted to extend Data Contexts. | ||
pub trait Merge { | ||
/// Merge "rhs" dataset into self, to form extend dataset. | ||
/// We use this for example to extend 24h RINEX to 1week RINEX. | ||
/// When merging File A and B types must match otherwise operation is invalid. | ||
fn merge(&self, rhs: &Self) -> Result<Self, Error> | ||
where | ||
Self: Sized; | ||
/// [Self::merge] mutable implementation. | ||
fn merge_mut(&mut self, rhs: &Self) -> Result<(), Error>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use hifitime::{Duration, Epoch}; | ||
|
||
fn moving_average<T: std::default::Default>( | ||
data: Vec<(Epoch, T)>, | ||
window: Duration, | ||
) -> Vec<(Epoch, T)> { | ||
let mut acc = T::default(); | ||
let mut prev_epoch: Option<Epoch> = None; | ||
let mut ret: Vec<(Epoch, T)> = Vec::new(); | ||
for (epoch, value) in data {} | ||
ret | ||
} | ||
|
||
#[derive(Debug, Clone, Copy)] | ||
pub enum Averager { | ||
MovingAverage(Duration), | ||
} | ||
|
||
impl Default for Averager { | ||
fn default() -> Self { | ||
Self::MovingAverage(Duration::from_seconds(600.0_f64)) | ||
} | ||
} | ||
|
||
impl Averager { | ||
pub fn mov(window: Duration) -> Self { | ||
Self::MovingAverage(window) | ||
} | ||
pub fn eval<T: std::default::Default>(&self, input: Vec<(Epoch, T)>) -> Vec<(Epoch, T)> { | ||
match self { | ||
Self::MovingAverage(dt) => moving_average(input, *dt), | ||
} | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::*; | ||
#[test] | ||
fn test_moving_average() { | ||
let mov = Averager::mov(Duration::from_seconds(10.0_f64)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
use crate::processing::{FilterItem, ItemError}; | ||
use hifitime::Duration; | ||
use thiserror::Error; | ||
|
||
/// Decimation filter parsing error | ||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
#[error("invalid decimated item")] | ||
InvalidDecimItem(#[from] ItemError), | ||
#[error("failed to parse decimation attribute \"{0}\"")] | ||
AttributeParsingError(String), | ||
} | ||
|
||
/// Type of decimation filter | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub enum DecimationFilterType { | ||
/// Simple modulo decimation | ||
Modulo(u32), | ||
/// Duration decimation | ||
Duration(Duration), | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq)] | ||
pub struct DecimationFilter { | ||
/// Type of decimation filter | ||
pub filter: DecimationFilterType, | ||
/// Optional decimated item. | ||
/// When item is None, all data is to be decimated. | ||
/// When item is specified, only that subset is to be decimated. | ||
pub item: Option<FilterItem>, | ||
} | ||
|
||
impl DecimationFilter { | ||
/// Builds a new Duration decimation filter | ||
pub fn duration(dt: Duration) -> Self { | ||
Self { | ||
item: None, | ||
filter: DecimationFilterType::Duration(dt), | ||
} | ||
} | ||
/// Builds new Modulo decimation filter | ||
pub fn modulo(modulo: u32) -> Self { | ||
Self { | ||
item: None, | ||
filter: DecimationFilterType::Modulo(modulo), | ||
} | ||
} | ||
/// Adds targetted item to be decimated | ||
pub fn with_item(&self, item: FilterItem) -> Self { | ||
let mut s = self.clone(); | ||
s.item = Some(item.clone()); | ||
s | ||
} | ||
} | ||
|
||
/// The [Decimate] trait is implemented to reduce data rate prior analysis. | ||
pub trait Decimate { | ||
/// Immutable decimation | ||
fn decimate(&self, f: &DecimationFilter) -> Self; | ||
/// Mutable decimation | ||
fn decimate_mut(&mut self, f: &DecimationFilter); | ||
} | ||
|
||
impl std::str::FromStr for DecimationFilter { | ||
type Err = Error; | ||
fn from_str(content: &str) -> Result<Self, Self::Err> { | ||
let items: Vec<&str> = content.trim().split(':').collect(); | ||
if let Ok(dt) = Duration::from_str(items[0].trim()) { | ||
Ok(Self { | ||
item: { | ||
if items.len() > 1 { | ||
let item = FilterItem::from_str(items[1].trim())?; | ||
Some(item) | ||
} else { | ||
None // no subset description | ||
} | ||
}, | ||
filter: DecimationFilterType::Duration(dt), | ||
}) | ||
} else if let Ok(r) = items[0].trim().parse::<u32>() { | ||
Ok(Self { | ||
item: { | ||
if items.len() > 1 { | ||
let item = FilterItem::from_str(items[1].trim())?; | ||
Some(item) | ||
} else { | ||
None | ||
} | ||
}, | ||
filter: DecimationFilterType::Modulo(r), | ||
}) | ||
} else { | ||
Err(Error::AttributeParsingError(items[0].to_string())) | ||
} | ||
} | ||
} |
Oops, something went wrong.