Skip to content

Commit

Permalink
Handle observations without significant epoch
Browse files Browse the repository at this point in the history
Event flags 2 - 5 allow the epoch fields to be left blank if they are
not "significant".

Fixes: georust#219
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
  • Loading branch information
jigpu committed Mar 31, 2024
1 parent 6556aaf commit 3f2a752
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion rinex/src/observation/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,24 @@ pub(crate) fn is_new_epoch(line: &str, v: Version) -> bool {
if line.len() < 30 {
false
} else {
epoch::parse_utc(&line[0..29]).is_ok()
let significant = line[0..26].trim().len() != 0;
let epoch = epoch::parse_utc(&line[0..26]);
let flag = EpochFlag::from_str(&line[26..29].trim());
if significant {
epoch.is_ok() && flag.is_ok()
} else {
if flag.is_err() {
false
} else {
match flag.unwrap() {
EpochFlag::AntennaBeingMoved
| EpochFlag::NewSiteOccupation
| EpochFlag::HeaderInformationFollows
| EpochFlag::ExternalEvent => true,
_ => false,
}
}
}
}
} else {
// Modern RINEX
Expand Down

0 comments on commit 3f2a752

Please sign in to comment.