Skip to content
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

WIP tweaks #150

Draft
wants to merge 3 commits into
base: nav-health
Choose a base branch
from
Draft

WIP tweaks #150

wants to merge 3 commits into from

Conversation

ljbade
Copy link
Contributor

@ljbade ljbade commented Aug 29, 2023

No description provided.

@@ -39,6 +39,6 @@ pub enum Bibliography {
/// [DOI](https://cdn.taoglas.com/wp-content/uploads/pdf/Multipath-Analysis-Using-Code-Minus-Carrier-Technique-in-GNSS-Antennas-_WhitePaper_VP__Final-1.pdf).
MpTaoglas,
/// QZSS Signal and Constellation interface specifications.
/// [DOI](https://qzss.go.jp/en/technical/download/pdf/ps-is-qzss/is-qzss-pnt-004.pdf)
/// [DOI](https://qzss.go.jp/en/technical/download/pdf/ps-is-qzss/is-qzss-pnt-005.pdf)
QzssPnt,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might also want to add reference to the Galileo and QZSS ICDs

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes definitely, this is work in progress, QZSS was the first dedicated specs I looked into, that's why it's there.

@@ -1,88 +1,84 @@
//! GAL Sv Health specifications
use bitflags::bitflags;
//! GAL SV Health specifications
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed all Sv to SV as SV is an acronym for Satellite Vehicle


/// GAL Sv Health indication
#[derive(Debug, Clone, PartialEq, PartialOrd)]
/// GAL INAV & FNAV SV Health indication.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RINEX v3 and v4 the Galileo health definition is the same for both INAV and FNAV

Though there is another field "data source" that indicates as well if INAV or FNAV (mainly for v3)

For INAV only bits for E1B and E5b can be set (since E5a not transmitted in INAV).

For FNAV only bits for E5a can be set (since E1B & E5b not transmitted in FNAV).

INAV(Health),
/// GAL FNAV Sv Health indication
FNAV(Health),
pub struct GALHealth {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to a struct (with to/from u32 conversions) as HS is actually a 2 bit integer and not two separate bit flags

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good idea

/// GPS CNV2 Sv Health indication
CNV2(Civilian2Health),
/// GPS Legacy SV Health indication
LNAV(LNAVHealth),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having the names of the structs similar to the enum cases is less confusing

const L2Healthy = 0x02;
const L5Healthy = 0x04;
}
/// GPS Legacy SV Health indication.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the Galileo struct, I also made this a struct as the lower 5 bits are actually a 5 bit integer

To tell health of just L1 or L2 some complex switch would be needed

}
}

bitflags! {
/// GPS CNAV-2 Sv Health indication.
/// See [Bibliography::RINEX4] for more information.
/// GPS CNAV & CNAV-2 SV Health indication.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPS has same definition of health bits in CNAV and CNAV-2 so I changed this to a single struct used in both enum cases

const L2Healthy = 0x02;
const L5Healthy = 0x04;
pub struct CNAVHealth: u8 {
/// L1 Signal Health
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed from L1Healthy to just L1 as Healthy makes it sound like true = healthy when the definition is actually the opposite

/// L1 Health
/// `false` = Healthy
/// `true` = Unhealthy
const L1 = 0x20;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it to L1 to match QZSS ICD

const L1C = 0x01 << 18;
const L1C_B = 0x01 << 17;

pub struct LNAVHealth: u64 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the bit definitions as the RINEX spec is trying to say that this value is 6 bits long, taken from bit positions 22-17 of the navigation data Word 3 of Subframe 1

const L5 = 0x01 << 54;
const L2 = 0x01 << 53;
const L1 = 0x01 << 52;
pub struct CNAVHealth: u8 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the bit definitions as the RINEX spec is trying to say that this value is 3 bits long, taken from bit positions 54-52 of the navigation data Message 10

impl std::fmt::UpperExp for GALHealth {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let value: u32 = u32::from(self);
write!(f, "{:e}", value as f32)
Copy link
Collaborator

@gwbres gwbres Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, all the NAV ecosystem implements the UpperExp formatting because that's how we (intend) to format those fields in file production contexts.

I say intend because NAV files production is the most problematic still to this day, while OBS and Meteo RINEX have been completed already.

/// LNAV data health
/// `false` = all LNAV data are OK
/// `true` = some or all LNAV data are bad
data: bool,
Copy link
Collaborator

@gwbres gwbres Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data: bool,
unhealthy: bool,

easier to grasp ?

@gwbres
Copy link
Collaborator

gwbres commented Aug 29, 2023

Ideally, we want to converge to an interface that makes it easy for us to apply a Healthy/UnHealthy And mask (Intersect in bitflags) to the dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants