-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve obsrinex test infra * working on substract ci * test more state of the art decompression * filename conventions * fix rad2deg * bump version * clippy * follow standard naming conventions, in data we generate * fix a tiny error in substraction ops * update doc * export data as csv if desired --------- Signed-off-by: Guillaume W. Bres <[email protected]>
- Loading branch information
Showing
38 changed files
with
2,024 additions
and
573 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,6 @@ Cargo.lock | |
|
||
rinex/merge.rnx | ||
rinex/test.crx | ||
rinex/test.rnx | ||
DATA/ | ||
WORKSPACE/ |
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,6 +1,6 @@ | ||
[package] | ||
name = "crx2rnx" | ||
version = "2.2.1" | ||
version = "2.3.0" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["Guillaume W. Bres <[email protected]>"] | ||
description = "RINEX data decompressor" | ||
|
@@ -12,4 +12,4 @@ readme = "README.md" | |
|
||
[dependencies] | ||
clap = { version = "4.4.10", features = ["derive", "color"] } | ||
rinex = { path = "../rinex", version = "=0.15.3", features = ["serde"] } | ||
rinex = { path = "../rinex", version = "=0.15.4", features = ["serde"] } |
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,4 @@ | ||
use clap::{Arg, ArgMatches, ColorChoice, Command}; | ||
use clap::{Arg, ArgAction, ArgMatches, ColorChoice, Command}; | ||
use std::path::{Path, PathBuf}; | ||
|
||
pub struct Cli { | ||
|
@@ -12,7 +12,7 @@ impl Cli { | |
matches: { | ||
Command::new("crx2rnx") | ||
.author("Guillaume W. Bres <[email protected]>") | ||
.version("2.0") | ||
.version(env!("CARGO_PKG_VERSION")) | ||
.about("Compact RINEX decompression tool") | ||
.arg_required_else_help(true) | ||
.color(ColorChoice::Always) | ||
|
@@ -23,10 +23,24 @@ impl Cli { | |
.help("Input RINEX file") | ||
.required(true), | ||
) | ||
.arg( | ||
Arg::new("short") | ||
.short('s') | ||
.long("short") | ||
.action(ArgAction::SetTrue) | ||
.conflicts_with("output") | ||
.help( | ||
"Prefer shortened filename convention. | ||
Otherwise, we default to modern (V3+) long filenames. | ||
Both will not work well if your input does not follow standard conventions at all.", | ||
), | ||
) | ||
.arg( | ||
Arg::new("output") | ||
.short('o') | ||
.long("output") | ||
.action(ArgAction::Set) | ||
.conflicts_with_all(["short"]) | ||
.help("Custom output file name"), | ||
) | ||
.arg( | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//! helpers to export to CSV if desired, | ||
//! and not only generate HTML plots. | ||
use hifitime::Epoch; | ||
use std::fs::File; | ||
use std::io::Write; | ||
use std::path::Path; | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
#[error("failed to write csv file")] | ||
IoError(#[from] std::io::Error), | ||
} | ||
|
||
/* | ||
* Use this to export Time domain plots (most widely used plot type) | ||
*/ | ||
pub fn csv_export_timedomain<T: std::fmt::UpperExp>( | ||
path: &Path, | ||
title: &str, | ||
labels: &str, | ||
x: &Vec<Epoch>, | ||
y: &Vec<T>, | ||
) -> Result<(), Error> { | ||
let mut fd = File::create(path)?; | ||
writeln!(fd, "================================================")?; | ||
writeln!(fd, "title : {}", title)?; | ||
writeln!(fd, "labels : {}", labels)?; | ||
writeln!( | ||
fd, | ||
"version: rinex-cli v{} - https://georust.org", | ||
env!("CARGO_PKG_VERSION") | ||
)?; | ||
writeln!(fd, "================================================")?; | ||
for (x, y) in x.iter().zip(y.iter()) { | ||
writeln!(fd, "{:?}, {:.6E}", x, y)?; | ||
} | ||
writeln!(fd, "================================================")?; | ||
Ok(()) | ||
} |
Oops, something went wrong.