Skip to content

Commit 6478766

Browse files
authored
Merge pull request #1 from rtk-rs/develop
Develop
2 parents fe3bce0 + 1e4b305 commit 6478766

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+7257
-2
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "12:00"
8+
open-pull-requests-limit: 10

.github/workflows/daily.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Daily
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *" # midnight, every day
7+
8+
env:
9+
RUST_BACKTRACE: 1
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
name: Build
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
include:
20+
- name: Default build
21+
opts: -r
22+
- name: All Features
23+
opts: --all-features
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: actions-rs/toolchain@v1
28+
name: Install Rust
29+
with:
30+
toolchain: stable
31+
override: true
32+
- name: Install Dependencies
33+
run: |
34+
sudo apt-get update
35+
36+
- name: ${{ matrix.name }}
37+
run: |
38+
cargo clean && cargo update && cargo build ${{ matrix.opts }}

.github/workflows/rust.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
tags:
7+
- "*"
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Build
22+
run: cargo build
23+
- name: Build (all features)
24+
run: cargo build --all-features
25+
- name: Coding style
26+
run: cargo fmt --all -- --check
27+
28+
release:
29+
name: Release
30+
runs-on: ubuntu-latest
31+
needs: [build]
32+
if: github.ref_type == 'tag'
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Install stable toolchain
37+
uses: dtolnay/rust-toolchain@master
38+
with:
39+
toolchain: stable
40+
- name: Publish
41+
env:
42+
TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
43+
run: |
44+
cargo login $TOKEN
45+
cargo publish

Cargo.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[package]
2+
name = "rinex-cli"
3+
version = "0.12.1"
4+
license = "MPL-2.0"
5+
authors = ["Guillaume W. Bres <[email protected]>"]
6+
description = "RINEX and SP3 data post processing tool"
7+
homepage = "https://github.com/rtk-rs"
8+
repository = "https://github.com/rtk-rs/rinex-cli"
9+
keywords = ["geo", "gps", "rinex", "galileo", "timing"]
10+
categories = [
11+
"science",
12+
"science::geo",
13+
"command-line-interface",
14+
"command-line-utilities",
15+
]
16+
edition = "2021"
17+
readme = "README.md"
18+
rust-version = "1.64"
19+
20+
[dependencies]
21+
log = "0.4"
22+
walkdir = "2.4.0"
23+
geo-types = "0.7.11"
24+
env_logger = "0.11"
25+
serde_json = "1"
26+
lazy_static = "1.4"
27+
thiserror = "1"
28+
itertools = "0.13"
29+
map_3d = "0.1.5"
30+
maud = "0.26"
31+
32+
clap = { version = "4.4.13", features = ["derive", "color"] }
33+
serde = { version = "1.0", default-features = false, features = ["derive"] }
34+
35+
kml = { version = "0.8.6", optional = true }
36+
gpx = { version = "0.10", optional = true }
37+
csv = { version = "1.3.0", optional = true }
38+
39+
plotly = "0.9"
40+
41+
anise = { version = "0.5.0", features = ["embed_ephem"] }
42+
hifitime = { version = "4.0.0", features = ["serde", "std"] }
43+
44+
gnss-rs = { version = "2.3.2", features = ["serde"] }
45+
gnss-rtk = { version = "0.7.5", features = ["serde"] }
46+
cggtts = { version = "4.2.0", features = ["serde", "scheduler"], optional = true }
47+
48+
rinex = { version = "=0.17.0-alpha-3", features = ["full"] }
49+
sp3 = { version = "=1.1.0-alpha-2", features = ["serde", "flate2"] }
50+
51+
gnss-qc = { version = "0.0.2", features = ["sp3"] }

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
1-
# rinex-cli
2-
RINEX post processing tool
1+
RINEX-Cli
2+
=========
3+
4+
[![Rust](https://github.com/rtk-rs/rinex-cli/actions/workflows/rust.yml/badge.svg)](https://github.com/rtk-rs/rinex-cli/actions/workflows/rust.yml)
5+
[![Rust](https://github.com/rtk-rs/rinex-cli/actions/workflows/daily.yml/badge.svg)](https://github.com/rtk-rs/rinex-cli/actions/workflows/daily.yml)
6+
[![crates.io](https://img.shields.io/crates/v/rinex-cli.svg)](https://crates.io/crates/rinex-cli)
7+
8+
[![License](https://img.shields.io/badge/license-MPL_2.0-orange?style=for-the-badge&logo=mozilla)](https://github.com/rtk-rs/rinex-cli/blob/main/LICENSE)
9+
10+
`rinex-cli` is a command line tool to post process RINEX + SP3 data.
11+
12+
## Licensing
13+
14+
This application is part of the [RTK-rs framework](https://github.com/rtk-rs) which
15+
is delivered under the [Mozilla V2 Public](https://www.mozilla.org/en-US/MPL/2.0) license.
16+
17+
## File formats & revisions
18+
19+
`rinex-cli` supports
20+
21+
- all formats & revisions supported by [the RINEX parser](https://github.com/georust/tree/main/rinex)
22+
- all revisions supported by [the SP3 parser](https://github.com/georust/tree/main/sp3)
23+
24+
Summary:
25+
26+
| Format | File name restrictions | Support |
27+
|------------------------|-----------------------------------|------------------------------------|
28+
| RINEX | :heavy_minus_sign: | :heavy_check_mark: |
29+
| CRINEX | :heavy_minus_sign: | :heavy_check_mark: |
30+
| gzip compressed RINEX | Name must end with `.gz` | `--flate2` feature must be enabled |
31+
| gzip compressed CRINEX | Name must end with `.gz` | `--flate2` feature must be enabled |
32+
| .Z compressed RINEX | Not supported | Not supported |
33+
| DORIS RINEX | :heavy_minus_sign: | :construction: Work in progress |
34+
| gzip compressed DORIS | Name must end with `.gz` | `--flate2` feature must be enabled |
35+
| .Z compressed DORIS | Not supported | Not supported |
36+
| SP3 | :heavy_minus_sign: | :heavy_check_mark: |
37+
| gzip compressed SP3 | Name must end with `.gz` | `--flate2` feature must be enabled |
38+
| .Z compressed SP3 | Not supported | Not supported |
39+
| BINEX | :heavy_minus_sign: | :heavy_minus_sign: |
40+
| UBX | :heavy_minus_sign: | :heavy_minus_sign: |
41+
42+
:heavy_minus_sign: No restrictions: file names do not have to follow naming conventions.
43+
44+
Special Thanks
45+
==============
46+
47+
These tools would not exist without the great libraries written by C. Rabotin,
48+
[check out his work](https://github.com/nyx-space).
49+
50+
Some features would not exist without the invaluable help of J. Lesouple, through
51+
our countless discussions. Check out his
52+
[PhD manuscript (french)](http://perso.recherche.enac.fr/~julien.lesouple/fr/publication/thesis/THESIS.pdf?fbclid=IwAR3WlHm0eP7ygRzywbL07Ig-JawvsdCEdvz1umJJaRRXVO265J9cp931YyI)

rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
match_block_trailing_comma = true
2+
newline_style = "Unix"

src/cli/fops/diff.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// sub opmode
2+
use clap::{value_parser, Arg, ArgAction, Command};
3+
use std::path::PathBuf;
4+
5+
use super::{SHARED_DATA_ARGS, SHARED_GENERAL_ARGS};
6+
7+
pub fn subcommand() -> Command {
8+
Command::new("diff")
9+
.arg_required_else_help(true)
10+
.about(
11+
"RINEX(A)-RINEX(B) substraction operation. This is a simple mean
12+
to compare two GNSS receivers to one another, by direct PR or Phase data comparison.",
13+
)
14+
.arg(
15+
Arg::new("file")
16+
.value_parser(value_parser!(PathBuf))
17+
.value_name("FILEPATH")
18+
.action(ArgAction::Set)
19+
.required(true)
20+
.help(
21+
"RINEX(B) to substract to a single RINEX file (A), that was previously loaded.",
22+
),
23+
)
24+
.next_help_heading("Production Environment")
25+
.args(SHARED_GENERAL_ARGS.iter())
26+
.next_help_heading("Data context")
27+
.args(SHARED_DATA_ARGS.iter())
28+
}

src/cli/fops/filegen.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// filegen opmode
2+
use clap::Command;
3+
4+
use super::{SHARED_DATA_ARGS, SHARED_GENERAL_ARGS};
5+
6+
pub fn subcommand() -> Command {
7+
Command::new("filegen")
8+
.long_flag("filegen")
9+
.arg_required_else_help(false)
10+
.about(
11+
"Parse, preprocess and generate new RINEX and/or SP3 data. Input forms are preserved. See --filegen --help."
12+
)
13+
.long_about("
14+
Use this mode to generate all file formats we support after preprocessing them.
15+
16+
Example (1): generate decimated RINEX Observations
17+
rinex-cli \\
18+
-f test_resources/CRNX/V3/ESBC00DNK_R_20201770000_01D_30S_MO.crx.gz \\
19+
-P decim:5min \\
20+
--filegen
21+
22+
Example (2): redefine production agency while we do that
23+
rinex-cli \\
24+
-f test_resources/CRNX/V3/ESBC00DNK_R_20201770000_01D_30S_MO.crx.gz \\
25+
-P decim:5min \\
26+
--filegen -a AGENCY
27+
"
28+
)
29+
.next_help_heading("Production Environment")
30+
.args(SHARED_GENERAL_ARGS.iter())
31+
.next_help_heading("Data context")
32+
.args(SHARED_DATA_ARGS.iter())
33+
}

src/cli/fops/merge.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Merge opmode
2+
use clap::{value_parser, Arg, ArgAction, Command};
3+
use std::path::PathBuf;
4+
5+
use super::{SHARED_DATA_ARGS, SHARED_GENERAL_ARGS};
6+
7+
pub fn subcommand() -> Command {
8+
Command::new("merge")
9+
.short_flag('m')
10+
.long_flag("merge")
11+
.arg_required_else_help(true)
12+
.about("Merge a RINEX into another and dump result. See -m --help.")
13+
.long_about(
14+
"Merge two files together.
15+
16+
1. OBS RINEX example.
17+
When working with OBS RINEX, you should consider files that come from the same station.
18+
Merge GPS data content, from two files into a single RINEX
19+
20+
rinex-cli \\
21+
-f test_resources/OBS/V3/VLNS0010.22O \\
22+
-P GPS \\
23+
-m test_resources/OBS/V3/VLNS0630.22O
24+
25+
1b. CRINEX example.
26+
When working with CRINEX, the file format is preserved:
27+
28+
rinex-cli \\
29+
-f test_resources/CRNX/V3/ACOR00ESP_R_20213550000_01D_30S_MO.crx \\
30+
-m test_resources/CRNX/V3/BME100HUN_R_20213550000_01D_30S_MO.crx
31+
32+
2. Compressed file.
33+
File compression is also preserved:
34+
35+
rinex-cli \\
36+
-f test_resources/CRNX/V3/ESBC00DNK_R_20201770000_01D_30S_MO.crx.gz \\
37+
-m test_resources/CRNX/V3/MOJN00DNK_R_20201770000_01D_30S_MO.crx.gz
38+
",
39+
)
40+
.arg(
41+
Arg::new("file")
42+
.value_parser(value_parser!(PathBuf))
43+
.value_name("FILEPATH")
44+
.action(ArgAction::Set)
45+
.required(true)
46+
.help("RINEX file to merge."),
47+
)
48+
.next_help_heading("Production Environment")
49+
.args(SHARED_GENERAL_ARGS.iter())
50+
.next_help_heading("Data context")
51+
.args(SHARED_DATA_ARGS.iter())
52+
}

0 commit comments

Comments
 (0)