Skip to content

Commit

Permalink
Navigation data correction
Browse files Browse the repository at this point in the history
In NAV RINEX, missing fields can also be represented as pure zeros

Signed-off-by: Guillaume W. Bres <[email protected]>
  • Loading branch information
gwbres committed Sep 30, 2023
1 parent 4f3d58b commit 3d9368d
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions rinex/src/navigation/ephemeris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ fn parse_orbits(
}

let (content, rem) = line.split_at(std::cmp::min(word_size, line.len()));
let content = content.trim();

if content.trim().len() == 0 {
if content.len() == 0 {
// omitted field
key_index += 1;
if nb_missing > 0 {
Expand All @@ -535,22 +536,26 @@ fn parse_orbits(
line = rem.clone();
continue;
}

if let Some((key, token)) = fields.get(key_index) {
//println!(
// "Key \"{}\"(index: {}) | Token \"{}\" | Content \"{}\"",
// key,
// key_index,
// token,
// content.trim()
//); //DEBUG
if !key.contains(&"spare") {
if let Ok(item) = OrbitItem::new(token, content.trim(), constell) {
map.insert(key.to_string(), item);
/*
* In NAV RINEX, unresolved data fields are either
* omitted (handled previously) or put a zeros
*/
if !content.contains(".000000000000E+00") {
if let Some((key, token)) = fields.get(key_index) {
//println!(
// "Key \"{}\"(index: {}) | Token \"{}\" | Content \"{}\"",
// key,
// key_index,
// token,
// content.trim()
//); //DEBUG
if !key.contains(&"spare") {
if let Ok(item) = OrbitItem::new(token, content, constell) {
map.insert(key.to_string(), item);
}
}
}
}

key_index += 1;
line = rem.clone();
}
Expand Down

0 comments on commit 3d9368d

Please sign in to comment.