-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Guillaume W. Bres <[email protected]>
- Loading branch information
Showing
37 changed files
with
11,916 additions
and
13 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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
debug/ | ||
target/ | ||
|
||
test_resources/ | ||
|
||
Cargo.lock | ||
|
||
*.png | ||
*.jpg | ||
*.swp | ||
*.swo | ||
**/*.rs.bk | ||
.DS_Store | ||
|
||
rinex/merge.rnx | ||
rinex/test.crx | ||
DATA/ |
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,2 +1,13 @@ | ||
[workspace] | ||
members = ["rinex", "crx2rnx", "rnx2crx", "qc-traits", "rinex-qc", "rinex-cli", "ublox-rnx", "sinex"] | ||
resolver = "2" | ||
members = [ | ||
"rinex", | ||
"crx2rnx", | ||
"rnx2crx", | ||
"qc-traits", | ||
"rinex-qc", | ||
"rinex-cli", | ||
"ublox-rnx", | ||
"sinex", | ||
"sp3", | ||
] |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "rinex-qc-traits" | ||
version = "0.1.0" | ||
version = "0.1.1" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["Guillaume W. Bres <[email protected]>"] | ||
description = "RINEX quality analysis specific traits" | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "rinex-qc" | ||
version = "0.1.1" | ||
version = "0.1.2" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["Guillaume W. Bres <[email protected]>"] | ||
description = "RINEX data analysis" | ||
|
@@ -26,9 +26,9 @@ strum_macros = "0.25" | |
horrorshow = "0.8" | ||
itertools = "0.11.0" | ||
statrs = "0.16" | ||
sp3 = { version = "1.0.2", features = ["serde"] } | ||
rinex-qc-traits = "0.1.0" | ||
rinex = { version = "0.13.1", features = ["obs", "nav", "qc", "processing"] } | ||
sp3 = { path = "../sp3", features = ["serde"] } | ||
rinex-qc-traits = { path = "../qc-traits" } | ||
rinex = { path = "../rinex", features = ["obs", "nav", "qc", "processing", "serde", "flate2"] } | ||
|
||
[dev-dependencies] | ||
serde_json = "1" |
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 = "rinex" | ||
version = "0.13.1" | ||
version = "0.13.2" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["Guillaume W. Bres <[email protected]>"] | ||
description = "Package to parse and analyze RINEX data" | ||
|
@@ -47,7 +47,7 @@ serde = { version = "1.0", optional = true, default-features = false, features = | |
flate2 = { version = "1.0.24", optional = true, default-features = false, features = ["zlib"] } | ||
hifitime = { version = "3.8", features = ["serde", "std"] } | ||
horrorshow = { version = "0.8", optional = true } | ||
rinex-qc-traits = { version = "0.1", optional = true } | ||
rinex-qc-traits = { path = "../rinex", optional = true } | ||
|
||
[dev-dependencies] | ||
serde_json = "1" | ||
|
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,31 @@ | ||
[package] | ||
name = "sp3" | ||
version = "1.0.3" | ||
license = "MIT OR Apache-2.0" | ||
authors = ["Guillaume W. Bres <[email protected]>"] | ||
description = "IGS SP3 file parser" | ||
homepage = "https://github.com/georust/sp3" | ||
repository = "https://github.com/georust/sp3" | ||
documentation = "https://docs.rs/sp3/" | ||
keywords = ["gnss", "timing", "gps", "glonass", "galileo", "igs"] | ||
categories = ["science", "science::geo", "parsing"] | ||
edition = "2021" | ||
readme = "README.md" | ||
|
||
[features] | ||
default = [] # no features by default | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docrs", "--generate-link-to-definition"] | ||
|
||
[build-dependencies] | ||
|
||
[dependencies] | ||
rinex = { path = "../rinex", features = ["serde"] } | ||
hifitime = "3.8.4" | ||
thiserror = "1" | ||
serde = { version = "1.0", optional = true, default-features = false, features = ["derive"] } | ||
flate2 = { version = "1.0.24", optional = true, default-features = false, features = ["zlib"] } | ||
|
||
[dev-dependencies] |
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,147 @@ | ||
# SP3 | ||
|
||
[![crates.io](https://img.shields.io/crates/v/sp3.svg)](https://crates.io/crates/sp3) | ||
[![Rust](https://github.com/georust/rinex/actions/workflows/rust.yml/badge.svg)](https://github.com/georust/rinex/actions/workflows/rust.yml) | ||
[![crates.io](https://docs.rs/sp3/badge.svg)](https://docs.rs/sp3/) | ||
[![crates.io](https://img.shields.io/crates/d/sp3.svg)](https://crates.io/crates/sp3) | ||
[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/georust/rinex/sp3/blob/main/LICENSE-APACHE) | ||
[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/georust/rinex/sp3/blob/main/LICENSE-MIT) | ||
|
||
SP3 Precise GNSS Orbit files parser. | ||
|
||
SP3 is specifid by [IGS](https://igs.org/products/#orbits_clocks). | ||
|
||
The parser only supports Revisions C & D at the moment and rejects revisions A & B. | ||
|
||
## Getting started | ||
|
||
Add "sp3" to you cargo file | ||
|
||
```toml | ||
[dependencies] | ||
sp3 = "1" | ||
``` | ||
|
||
Parse an SP3 file | ||
|
||
```rust | ||
use crate::prelude::*; | ||
use rinex::prelude::Constellation; | ||
use std::path::PathBuf; | ||
use std::str::FromStr; | ||
|
||
let path = PathBuf::new() | ||
.join(env!("CARGO_MANIFEST_DIR")) | ||
.join("data") | ||
.join("ESA0OPSRAP_20232390000_01D_15M_ORB.SP3.gz"); | ||
|
||
let sp3 = SP3::from_file(&path.to_string_lossy()); | ||
assert!( | ||
sp3.is_ok(), | ||
"failed to parse ESA0OPSRAP_20232390000_01D_15M_ORB.SP3.gz : {:?}", | ||
sp3.err() | ||
); | ||
|
||
let sp3 = sp3.unwrap(); | ||
|
||
/* | ||
* Test general infos | ||
*/ | ||
assert_eq!(sp3.version, Version::C); | ||
assert_eq!(sp3.data_type, DataType::Position); | ||
|
||
assert_eq!( | ||
sp3.first_epoch(), | ||
Some(Epoch::from_str("2023-08-27T00:00:00 GPST").unwrap()) | ||
); | ||
|
||
assert_eq!(sp3.nb_epochs(), 96, "bad number of epochs"); | ||
assert_eq!(sp3.coord_system, "ITRF2"); | ||
assert_eq!(sp3.orbit_type, OrbitType::BHN); | ||
assert_eq!(sp3.time_system, TimeScale::GPST); | ||
assert_eq!(sp3.constellation, Constellation::Mixed); | ||
assert_eq!(sp3.agency, "ESOC"); | ||
|
||
assert_eq!(sp3.week_counter, (2277, 0.0_f64)); | ||
assert_eq!(sp3.epoch_interval, Duration::from_seconds(900.0_f64)); | ||
|
||
// browse SV positions | ||
for (epoch, sv, (x, y, z)) in sp3.sv_position() { | ||
|
||
} | ||
|
||
// browse SV clock | ||
for (epoch, sv, clock) in sp3.sv_clock() { | ||
|
||
} | ||
``` | ||
|
||
## File Merge | ||
|
||
Merge files together, for example to create a context spanning 48 hours | ||
|
||
```rust | ||
let folder = PathBuf::new() | ||
.join(env!("CARGO_MANIFEST_DIR")) | ||
.join("data"); | ||
|
||
let sp3_a = folder.clone() | ||
.join("ESA0OPSRAP_20232390000_01D_15M_ORB.SP3.gz"); | ||
|
||
let sp3_b = folder.clone() | ||
.join("ESA0OPSULT_20232320600_02D_15M_ORB.SP3.gz"); | ||
|
||
let sp3 = SP3::from_file(&sp3_a.to_string_lossy()) | ||
.unwrap(); | ||
|
||
let sp3_b = SP3::from_file(&sp3_b.to_string_lossy()) | ||
.unwrap(); | ||
|
||
let sp3 = sp3_a.merge(sp3_b); | ||
assert!(sp3.is_ok()); | ||
``` | ||
|
||
## Position Vector Interpolation | ||
|
||
Interpolate SV position at desired Epoch. | ||
In order to preserve the high (+/- 1mm precision) for SP3 datasets, | ||
we recommend using at least an interpolation order of 9 for typical SP3 files | ||
with 15' epoch intervals. | ||
|
||
The current implementation restricts the interpolatable Epochs at | ||
[tmin, tmax] = [(N +1)/2 * τ, T(n-1) - (N +1)/2 * τ], | ||
both included, where N is the interpolation order, τ the epoch interval, and T(n-1) | ||
the last Epoch in this file. | ||
|
||
Refer to the online API for more information | ||
|
||
```rust | ||
use sp3::prelude::*; | ||
use rinex::sv; | ||
use std::str::FromStr; | ||
use std::path::PathBuf; | ||
use rinex::prelude::Sv; | ||
|
||
let path = PathBuf::new() | ||
.join(env!("CARGO_MANIFEST_DIR")) | ||
.join("data") | ||
.join("ESA0OPSRAP_20232390000_01D_15M_ORB.SP3.gz"); | ||
|
||
let sp3 = SP3::from_file(&path.to_string_lossy()) | ||
.unwrap(); | ||
|
||
let epoch = Epoch::from_str("2023-08-27T00:00:00 GPST") | ||
.unwrap(); | ||
let interpolated = sp3.interpolate(epoch, sv!("G01"), 11); | ||
assert!(interpolated.is_none(), "too early in this file"); | ||
|
||
let epoch = Epoch::from_str("2023-08-27T08:15:00 GPST") | ||
.unwrap(); | ||
let interpolated = sp3.interpolate(epoch, sv!("G01"), 11); | ||
assert!(interpolated.is_some()); | ||
let (x, y, z) = interpolated.unwrap(); | ||
// demonstrate error is still sub cm | ||
assert!((x - 13281.083885).abs() * 1.0E3 < 1.0E-2); // distances are expressed in km in all SP3 | ||
assert!((y - -11661.887057).abs() * 1.0E3 < 1.0E-2); | ||
assert!((z - 19365.687261).abs() * 1.0E3 < 1.0E-2); | ||
``` |
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,14 @@ | ||
pub enum Bibliography { | ||
/// SP3 -D revision specifications | ||
/// [DOI]() | ||
SP3dRev, | ||
/// SP3 -C revision specifications | ||
/// [DOI]() | ||
SP3cRev, | ||
/// C. Japhet, 2021 * Méthodes Numériques II - Interpolation Polynomiale * | ||
/// [DOI]() | ||
Japhet2021, | ||
/// Univ. Rennes UFR Maths, * Interpolation polynomiale, Interpolation de Lagrange * | ||
/// [DOI]() | ||
UFRRennes, | ||
} |
Oops, something went wrong.