Skip to content

Ephemeris #374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ To contribute to either of our project or join our community, you way
- Fast
- Open sources: read and access all the code!
- All modern GNSS constellations, codes and signals
- Surveying with GPS, Galileo, BeiDou and QZSS
- Time scales: GPST, QZSST, BDT, GST, UTC, TAI
- Navigation is supported and verified for the following constellations:
- GPS (any)
- Galileo (any)
- BDS (not IGSO, not GEO)
- QZSS (not GEO)
- Supported timescales: GPST, QZSST, BDT, GST, UTC and TAI
- Efficient seamless compression and decompression
- RINEX V4 full support, including
- new Ionospheric coorections
- new Time offset corrections
- precise Earth Orientation updates
- Navigation supported in the following constellations
- GPS
- Galileo
- BeiDou
- QZSS
- Most RINEX formats supported (see following table)
- High Precision Clock RINEX products (for PPP)
- DORIS (special RINEX)
Expand Down
36 changes: 18 additions & 18 deletions db/NAV/orbits.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,15 @@
"major": 1
},
"orbits": {
"satPosX": "f64",
"posX": "f64",
"velX": "f64",
"accelX": "f64",
"health": "flag",
"satPosY": "f64",
"posY": "f64",
"velY": "f64",
"accelY": "f64",
"channel": "i8",
"satPosZ": "f64",
"posZ": "f64",
"velZ": "f64",
"accelZ": "f64",
"ageOp": "f64"
Expand All @@ -244,15 +244,15 @@
"major": 2
},
"orbits": {
"satPosX": "f64",
"posX": "f64",
"velX": "f64",
"accelX": "f64",
"health": "flag",
"satPosY": "f64",
"posY": "f64",
"velY": "f64",
"accelY": "f64",
"channel": "i8",
"satPosZ": "f64",
"posZ": "f64",
"velZ": "f64",
"accelZ": "f64",
"ageOp": "f64"
Expand All @@ -264,15 +264,15 @@
"major": 3
},
"orbits": {
"satPosX": "f64",
"posX": "f64",
"velX": "f64",
"accelX": "f64",
"health": "flag",
"satPosY": "f64",
"posY": "f64",
"velY": "f64",
"accelY": "f64",
"channel": "i8",
"satPosZ": "f64",
"posZ": "f64",
"velZ": "f64",
"accelZ": "f64",
"ageOp": "f64"
Expand All @@ -285,15 +285,15 @@
},
"type": "FDMA",
"orbits": {
"satPosX": "f64",
"posX": "f64",
"velX": "f64",
"accelX": "f64",
"health": "flag",
"satPosY": "f64",
"posY": "f64",
"velY": "f64",
"accelY": "f64",
"channel": "i8",
"satPosZ": "f64",
"posZ": "f64",
"velZ": "f64",
"accelZ": "f64",
"ageOp": "f64",
Expand Down Expand Up @@ -797,15 +797,15 @@
"major": 3
},
"orbits": {
"satPosX": "f64",
"posX": "f64",
"velX": "f64",
"accelX": "f64",
"health": "flag",
"satPosY": "f64",
"posY": "f64",
"velY": "f64",
"accelY": "f64",
"accuracyCode": "f64",
"satPosZ": "f64",
"posZ": "f64",
"velZ": "f64",
"accelZ": "f64",
"iodn": "f64"
Expand All @@ -818,15 +818,15 @@
},
"type": "SBAS",
"orbits": {
"satPosX": "f64",
"posX": "f64",
"velX": "f64",
"accelX": "f64",
"health": "flag",
"satPosY": "f64",
"posY": "f64",
"velY": "f64",
"accelY": "f64",
"accuracyCode": "f64",
"satPosZ": "f64",
"posZ": "f64",
"velZ": "f64",
"accelZ": "f64",
"iodn": "f64"
Expand Down
12 changes: 6 additions & 6 deletions src/binex/rnx2bin/nav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ fn forge_sbas_ephemeris_frame(_toc: &Epoch, sv: SV, eph: &Ephemeris) -> Option<E
let clock_offset = eph.clock_bias;
let clock_drift = eph.clock_drift;

let x_km = eph.orbits.get("satPosX")?.as_f64();
let x_km = eph.orbits.get("posX")?.as_f64();
let vel_x_km = eph.orbits.get("velX")?.as_f64();
let acc_x_km = eph.orbits.get("accelX")?.as_f64();

let y_km = eph.orbits.get("satPosX")?.as_f64();
let y_km = eph.orbits.get("posX")?.as_f64();
let vel_y_km = eph.orbits.get("velY")?.as_f64();
let acc_y_km = eph.orbits.get("accelY")?.as_f64();

let z_km = eph.orbits.get("satPosX")?.as_f64();
let z_km = eph.orbits.get("posX")?.as_f64();
let vel_z_km = eph.orbits.get("velZ")?.as_f64();
let acc_z_km = eph.orbits.get("accelZ")?.as_f64();

Expand Down Expand Up @@ -180,15 +180,15 @@ fn forge_glo_ephemeris_frame(eph: &Ephemeris) -> Option<EphemerisFrame> {
let clock_offset_s = eph.clock_bias;
let clock_rel_freq_bias = eph.clock_drift;

let x_km = eph.orbits.get("satPosX")?.as_f64();
let x_km = eph.orbits.get("posX")?.as_f64();
let vel_x_km = eph.orbits.get("velX")?.as_f64();
let acc_x_km = eph.orbits.get("accelX")?.as_f64();

let y_km = eph.orbits.get("satPosX")?.as_f64();
let y_km = eph.orbits.get("posX")?.as_f64();
let vel_y_km = eph.orbits.get("velY")?.as_f64();
let acc_y_km = eph.orbits.get("accelY")?.as_f64();

let z_km = eph.orbits.get("satPosX")?.as_f64();
let z_km = eph.orbits.get("posX")?.as_f64();
let vel_z_km = eph.orbits.get("velZ")?.as_f64();
let acc_z_km = eph.orbits.get("accelZ")?.as_f64();

Expand Down
7 changes: 2 additions & 5 deletions src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! const value of Gnss

#[cfg(feature = "nav")]
use crate::prelude::{Constellation, SV};

Expand Down Expand Up @@ -41,9 +39,6 @@ pub(crate) struct Constants;

#[cfg(feature = "nav")]
impl Constants {
/// Maximal iteration in the iterative Kepler solver
pub const MAX_KEPLER_ITER: u8 = 30;

/// Earth gravitation.
pub const fn gm(sv: SV) -> f64 {
match sv.constellation {
Expand All @@ -53,6 +48,7 @@ impl Constants {
_ => GM::GPS,
}
}

/// Earth rotation rate
pub const fn omega(sv: SV) -> f64 {
match sv.constellation {
Expand All @@ -62,6 +58,7 @@ impl Constants {
_ => Omega::GPS,
}
}

/// Auxiliary Quantities for Calculating Relativistic Effects in Clock Correction
pub const fn dtr_f(sv: SV) -> f64 {
match sv.constellation {
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/ephemeris/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Ephemeris {
// following standard specs
let data_fields = &standard_specs.items;
for i in 0..data_fields.len() {
if let Some(value) = self.get_orbit_f64(data_fields[i].0) {
if let Some(value) = self.get_orbit_field_f64(data_fields[i].0) {
if i % 4 == 0 {
write!(w, "\n {}", NavFormatter::new(value))?;
} else {
Expand Down
Loading
Loading