Skip to content

Commit 882b01b

Browse files
authored
Jpl gh 286 (#290)
* improve error msg * Fix offline/online deployment options - a new --jpl-bpc option is introduced in RINEX-Cli Which always requires internet access and IS THE ONLY OPTION to keep the JPL model up to date. - the local storage is preserved and allows fast deployments (after a first successful deployment) - for example, in the past few days the JPL servers have been down. when deploying without --jpl-bpc: - the session will rely on the previous JPL model if it was already downloaded. If this model is too long and servers remain down, you should delete it with! - the session will rely on low precision (offline) model until a JPL model has been obtained When deploying with --jpl-bpc: - the session will crash because correct network access is expected --------- Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent 8ddccae commit 882b01b

File tree

4 files changed

+202
-87
lines changed

4 files changed

+202
-87
lines changed

rinex-cli/src/cli/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ to operate the RINEX/SP3/RTK toolkit, until a GUI is made available.
114114
Use it to analyze data, perform file operations and resolve navigation solutions.")
115115
.arg_required_else_help(true)
116116
.color(ColorChoice::Always)
117+
.next_help_heading("Context")
117118
.arg(Arg::new("filepath")
118119
.long("fp")
119120
.value_name("FILE")
@@ -182,6 +183,13 @@ but you can extend that with --depth. Refer to -f for more information."))
182183
By default the $RINEX_WORKSPACE variable is prefered if it is defined.
183184
You can also use this flag to customize it.
184185
If none are defined, we will then try to create a local directory named \"WORKSPACE\" like it is possible in this very repo."))
186+
.arg(Arg::new("jpl-bpc")
187+
.long("jpl-bpc")
188+
.action(ArgAction::SetTrue)
189+
.help("Force update or request upgrade to highest precision JPL daily model.
190+
Requires internet access on each deployment!
191+
Once downloaded (updated) a model is valid for a couple of days or weeks, but you should regularly update
192+
to obtain highest precision."))
185193
.next_help_heading("Output customization")
186194
.arg(
187195
Arg::new("output-name")
@@ -482,4 +490,9 @@ Otherwise it gets automatically picked up."))
482490
pub fn custom_output_name(&self) -> Option<&String> {
483491
self.matches.get_one::<String>("output-name")
484492
}
493+
494+
/// True if jpl_bpc_update is requested
495+
pub fn jpl_bpc_update(&self) -> bool {
496+
self.matches.get_flag("jpl-bpc")
497+
}
485498
}

rinex-cli/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ fn user_data_parsing(
7373
max_depth: usize,
7474
is_rover: bool,
7575
) -> QcContext {
76-
let mut ctx =
77-
QcContext::new().unwrap_or_else(|e| panic!("failed to initialize new context {}", e));
76+
let mut ctx = QcContext::new(cli.jpl_bpc_update())
77+
.unwrap_or_else(|e| panic!("failed to initialize a context: {}", e));
7878

7979
// recursive dir loader
8080
for dir in directories.iter() {

rinex-qc/README.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ When built with `flate2` support, gzip compressed files can be naturally loaded:
3636
```rust
3737
use rinex_qc::prelude::*;
3838

39+
3940
// Build a setup
40-
// This will deploy with latest Almanac set for high performances
41-
let mut ctx = QcContext::new()
41+
// This will not deploy with latest Almanac set for highest performances
42+
let update_model = false;
43+
let mut ctx = QcContext::new(update_model)
4244
.unwrap();
4345

4446
let cfg = QcConfig::default(); // basic
@@ -66,7 +68,8 @@ Once again, gzip compressed files are naturally supported when built with `flate
6668
use rinex_qc::prelude::*;
6769

6870
// Build a setup
69-
let mut ctx = QcContext::new()
71+
let update_model = false;
72+
let mut ctx = QcContext::new(update_model)
7073
.unwrap();
7174

7275
let cfg = QcConfig::default(); // basic
@@ -92,23 +95,27 @@ force the consideration (along SP3) by using a custom `QcConfig`:
9295
use rinex_qc::prelude::*;
9396

9497
// Build a setup
95-
let mut ctx = QcContext::new()
98+
let update_model = false;
99+
100+
let mut ctx = QcContext::new(update_model)
96101
.unwrap();
102+
97103
let cfg = QcConfig::default(); // basic
98104
```
99105

100106
## PPP analysis
101107

102108
PPP compliant contexts are made of RINEX files and SP3 files, for the same time frame.
103109
The QcSummary report will let you know how compliant your input context is
104-
and what may restrict performances:
110+
and what may restrict performances.
111+
105112

106113
```rust
107114
use rinex_qc::prelude::*;
108115

109116
// basic setup
110-
let mut ctx = QcContext::new().unwrap();
111-
let cfg = QcConfig::default();
117+
let update_model = false;
118+
let mut ctx = QcContext::new(update_model).unwrap();
112119
```
113120

114121
## Custom chapters
@@ -118,8 +125,8 @@ Format your custom chapters as `QcExtraPage` so you can create your own report!
118125
```rust
119126
use rinex_qc::prelude::*;
120127

121-
let mut ctx = QcContext::new().unwrap();
122-
let cfg = QcConfig::default(); // basic setup
128+
let update_model = false;
129+
let mut ctx = QcContext::new(update_model).unwrap();
123130
```
124131

125132
## More info

0 commit comments

Comments
 (0)