API Reference
Decoder State
GNSSDecoder.GNSSDecoderState — Type
struct GNSSDecoderState{D<:GNSSDecoder.AbstractGNSSData, C<:GNSSDecoder.AbstractGNSSConstants, CA<:GNSSDecoder.AbstractGNSSCache}Generic decoder state for GNSS signal decoding. This parametric struct holds all state required for decoding navigation messages from GNSS satellites.
The struct itself is immutable; per-field reconstruction works via the keyword constructor, and the per-signal constants and decoded data carry value semantics. The one piece of intentionally-mutable state is the soft-symbol buffer inside the cache: a CircularDeque{Float32} of capacity syncro_sequence_length + preamble_length that accumulates incoming symbols across successive decode calls. It is a mutable container shared by reference between an input state and the state decode returns — fully immutable threading would copy the whole buffer on every symbol, which is the wrong trade for a streaming decoder. Treat the value returned by decode as the live state and do not keep mutating an earlier snapshot in parallel. The transient packed-bit buffer used for preamble matching is not stored here; it is computed as a local value at sync time and threaded through the sync path (see pack_buffer / try_sync).
Type Parameters
D<:AbstractGNSSData: The data type holding decoded navigation message fieldsC<:AbstractGNSSConstants: Constants specific to the GNSS system (e.g., preamble, timing)CA<:AbstractGNSSCache: Cache for intermediate decoding state (carries the soft-symbol buffer)
Fields
prn::Int64: Pseudo-Random Noise code identifier for the satelliteraw_data::GNSSDecoder.AbstractGNSSData: Partially decoded navigation data (not yet validated)data::GNSSDecoder.AbstractGNSSData: Validated navigation data ready for useconstants::GNSSDecoder.AbstractGNSSConstants: System-specific constants (preamble, timing parameters)cache::GNSSDecoder.AbstractGNSSCache: Cache for intermediate decoding state (holds the soft-symbolCircularDeque{Float32})num_bits_after_valid_syncro_sequence::Union{Nothing, Int64}: Number of symbols received after the last valid synchronization sequence, ornothingif not yet synchronizedis_shifted_by_180_degrees::Bool: Whether the signal phase is inverted by 180 degrees
See Also
GPSL1CADecoderState: Constructor for GPS L1 C/A decoder stateGalileoE1BDecoderState: Constructor for Galileo E1B decoder statedecode: Main function to decode soft symbols using this statereset_decoder_state: Reset decoder state after signal loss
Constructors
GNSSDecoder.GPSL1CADecoderState — Function
GPSL1CADecoderState(
prn
) -> GNSSDecoderState{GNSSDecoder.GPSL1CAData, GNSSDecoder.GPSL1CAConstants, GNSSDecoder.GPSL1CACache}
Create a decoder state for GPS L1 C/A navigation messages.
Initializes a GNSSDecoderState configured for decoding GPS L1 C/A (Coarse/Acquisition) civil navigation messages. The decoder extracts ephemeris, clock correction, and health data from the 50 bps LNAV data stream.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-32 for GPS satellites)
Returns
GNSSDecoderState{GPSL1CAData}: Initialized decoder state for GPS L1
Example
state = GPSL1CADecoderState(1) # Create decoder for PRN 1
state = decode(state, bits, num_bits)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode bits using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.GalileoE1BDecoderState — Function
GalileoE1BDecoderState(
prn
) -> GNSSDecoderState{GNSSDecoder.GalileoE1BData, GNSSDecoder.GalileoE1BConstants, GNSSDecoder.GalileoE1BCache}
Create a decoder state for Galileo E1B I/NAV navigation messages.
Initializes a GNSSDecoderState configured for decoding Galileo E1B (Open Service) navigation messages. The decoder extracts ephemeris, clock correction, ionospheric parameters, and health data from the 250 bps I/NAV data stream using Viterbi decoding.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-36 for Galileo satellites)
Returns
GNSSDecoderState{GalileoE1BData}: Initialized decoder state for Galileo E1B
Example
state = GalileoE1BDecoderState(1) # Create decoder for PRN 1
state = decode(state, bits, num_bits)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode bits using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.GalileoE5aDecoderState — Function
GalileoE5aDecoderState(
prn
) -> GNSSDecoderState{GNSSDecoder.GalileoE5aData, GNSSDecoder.GalileoE5aConstants, GNSSDecoder.GalileoE5aCache}
Create a decoder state for Galileo E5a F/NAV navigation messages.
Initializes a GNSSDecoderState configured for decoding Galileo E5a (Open Service) F/NAV navigation messages. The decoder extracts ephemeris, clock correction, ionospheric parameters, almanac, and health data from the 50 sps F/NAV data stream broadcast on the E5a-I component using Viterbi decoding.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-36 for Galileo satellites)
Returns
GNSSDecoderState{GalileoE5aData}: Initialized decoder state for Galileo E5a
Example
state = GalileoE5aDecoderState(21) # Create decoder for PRN 21
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.GPSL1C_DDecoderState — Function
GPSL1C_DDecoderState(
prn
) -> GNSSDecoderState{GPSL1C_DData, GNSSDecoder.GPSL1C_DConstants, GNSSDecoder.GPSL1C_DCache}
Create a decoder state for GPS L1C-D (CNAV-2) navigation messages.
Wires up a GNSSDecoderState with a 1852-symbol soft-symbol buffer, the 400-entry BCH(51,8) TOI codeword table (src/bch_toi.jl), and two Aff3ct LDPC belief-propagation decoders loaded lazily from the committed .alist parity matrices in data/.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for L1C).
Returns
GNSSDecoderState{GPSL1C_DData}: Initialized decoder state for GPS L1C-D.
Example
state = GPSL1C_DDecoderState(1) # PRN 1
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal loss
GNSSDecoder.GPSL5IDecoderState — Function
GPSL5IDecoderState(
prn
) -> GNSSDecoderState{GPSCNAVData, GNSSDecoder.GPSCNAVConstants{:GPSL5I}, GNSSDecoder.GPSCNAVCache}
Create a decoder state for GPS L5I CNAV navigation messages.
Initializes a GNSSDecoderState configured for decoding GPS L5I civil navigation (CNAV) messages from FEC-encoded 100 sps soft symbols. Each sync attempt Viterbi-decodes the buffered 616-symbol window, locates the 8-bit preamble (0b10001011) at both ends of the decoded bit window, validates the 300-bit message with CRC-24Q, and dispatches it to per-type parsers (message types 10-15, 30-37, and 40, IS-GPS-705J §20.3.3).
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for GPS satellites)
Returns
GNSSDecoderState{GPSCNAVData}: Initialized decoder state for GPS L5I
Example
state = GPSL5IDecoderState(1) # PRN 1
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structureGPSL2CMDecoderState: The GPS L2C decoder sharing this CNAV coredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.GPSL2CMDecoderState — Function
GPSL2CMDecoderState(
prn
) -> GNSSDecoderState{GPSCNAVData, GNSSDecoder.GPSCNAVConstants{:GPSL2CM}, GNSSDecoder.GPSCNAVCache}
Create a decoder state for GPS L2C CNAV navigation messages.
Initializes a GNSSDecoderState configured for decoding GPS L2C civil navigation (CNAV) messages from the FEC-encoded 50 sps soft symbols of the L2 CM component. The CNAV message is identical to GPS L5I's, so decoding reuses the shared GPS CNAV core: each sync attempt Viterbi-decodes the buffered 616-symbol window, locates the 8-bit preamble (0b10001011) at both ends of the decoded bit window, validates the 300-bit message with CRC-24Q, and dispatches it to per-type parsers (message types 10-15, 30-37, and 40, IS-GPS-200N §30.3.3). Decoded fields land in a GPSCNAVData (the shared CNAV container).
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for GPS satellites)
Returns
GNSSDecoderState{GPSCNAVData}: Initialized decoder state for GPS L2C
Example
state = GPSL2CMDecoderState(1) # PRN 1
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structureGPSL5IDecoderState: The GPS L5I decoder sharing this CNAV coredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.BeiDouB1IDecoderState — Function
BeiDouB1IDecoderState(
prn
) -> GNSSDecoderState{BeiDouDNAVData, GNSSDecoder.BeiDouDNAVConstants{:BeiDouB1I}, GNSSDecoder.BeiDouDNAVCache}
Create a decoder state for BeiDou B1I legacy navigation messages (D1/D2 NAV).
Initializes a GNSSDecoderState configured for decoding the BeiDou legacy navigation message from B1I soft symbols. For MEO/IGSO satellites (PRN 6-58) that is the D1 message: 50 bps data bits after wipe-off of the NH20 secondary code. For GEO satellites (PRN 1-5 and 59-63) it is the D2 message at 500 bps (no secondary code); the decoder selects the format from the PRN. Each 300-bit subframe is synchronized via the 11-bit preamble 11100010010, BCH(15,11,1)-decoded per word, and parsed into a BeiDouDNAVData (the container shared with B3I).
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for BeiDou satellites)
Returns
GNSSDecoderState{BeiDouDNAVData}: Initialized decoder state for BeiDou B1I
Example
state = BeiDouB1IDecoderState(20) # PRN 20 (MEO/IGSO ⇒ D1)
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structureBeiDouB3IDecoderState: The B3I decoder sharing this legacy NAV coredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.BeiDouB3IDecoderState — Function
BeiDouB3IDecoderState(
prn
) -> GNSSDecoderState{BeiDouDNAVData, GNSSDecoder.BeiDouDNAVConstants{:BeiDouB3I}, GNSSDecoder.BeiDouDNAVCache}
Create a decoder state for BeiDou B3I legacy navigation messages (D1/D2 NAV).
Initializes a GNSSDecoderState configured for decoding the BeiDou legacy navigation message from B3I soft symbols. The message is identical to B1I's (see BeiDouB1IDecoderState), so decoding reuses the shared legacy NAV core: D1 (50 bps, after NH20 wipe-off) for MEO/IGSO PRNs, D2 (500 bps) for GEO PRNs, 11-bit preamble sync, per-word BCH(15,11,1) correction, and parsing into the shared BeiDouDNAVData container.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for BeiDou satellites)
Returns
GNSSDecoderState{BeiDouDNAVData}: Initialized decoder state for BeiDou B3I
Example
state = BeiDouB3IDecoderState(30) # PRN 30 (MEO/IGSO ⇒ D1)
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structureBeiDouB1IDecoderState: The B1I decoder sharing this legacy NAV coredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.BeiDouB1CDecoderState — Function
BeiDouB1CDecoderState(
prn
) -> GNSSDecoderState{BeiDouB1CData, GNSSDecoder.BeiDouB1CConstants, GNSSDecoder.BeiDouB1CCache}
Create a decoder state for BeiDou B1C (B-CNAV1) navigation messages.
Wires up a GNSSDecoderState with a 1872-symbol soft-symbol buffer, the BCH(21,6) PRN / BCH(51,8) SOH subframe-1 codeword tables, and two Aff3ct LDPC belief-propagation decoders loaded from the committed binary-image .alist parity matrices in data/ (see scripts/generate_beidou_alist.jl).
Like GPS L1C-D, the LDPC decode is flooding sum-product and therefore scale-sensitive: feed soft symbols whose magnitudes are confidence-weighted on a roughly LLR-like scale (≈ 2·r/σ²) for best performance at marginal SNR (see the soft-symbol convention note on decode).
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for BeiDou).
Returns
GNSSDecoderState{BeiDouB1CData}: Initialized decoder state for BeiDou B1C.
Example
state = BeiDouB1CDecoderState(30) # PRN 30
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal loss
GNSSDecoder.BeiDouB2aDecoderState — Function
BeiDouB2aDecoderState(
prn
) -> GNSSDecoderState{BeiDouB2aData, GNSSDecoder.BeiDouB2aConstants, GNSSDecoder.BeiDouB2aCache}
Create a decoder state for BeiDou B2a (B-CNAV2) navigation messages.
Initializes a GNSSDecoderState configured for decoding the B-CNAV2 message from the 200 sps soft symbols of the B2a data component (BDS-SIS-ICD-B2a-1.0). Each sync attempt matches the 24-symbol preamble 0xE24DE8 at both ends of the buffered 600-symbol frame window (in either polarity); a matched frame is LDPC-decoded through the binary image of the ICD's 64-ary LDPC(96,48) code, gated on CRC-24Q and on the broadcast PRN matching this decoder's PRN, and dispatched to per-message-type parsers (message types 10, 11, 30-34, and 40). Decoded fields land in a BeiDouB2aData.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for BeiDou satellites)
Returns
GNSSDecoderState{BeiDouB2aData}: Initialized decoder state for BeiDou B2a
Example
state = BeiDouB2aDecoderState(19) # PRN 19
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
GNSSDecoder.BeiDouB2bDecoderState — Function
BeiDouB2bDecoderState(
prn
) -> GNSSDecoderState{BeiDouB2bData, GNSSDecoder.BeiDouB2bConstants, GNSSDecoder.BeiDouB2bCache}
Create a decoder state for BeiDou B2b (B-CNAV3) navigation messages.
Initializes a GNSSDecoderState configured for decoding B-CNAV3 messages from the 1000 sps soft symbols of the B2b_I component (BDS-SIS-ICD-B2b-1.0). Each sync attempt matches the 16-symbol preamble 0xEB90 at both ends of the 1016-symbol window, checks the 6 unencoded PRN symbols against prn, LDPC-decodes the 972 encoded symbols through the binary image of the ICD's 64-ary LDPC(162, 81) code, and validates the 486-bit message with CRC-24Q before dispatching it to the per-type parsers (message types 10, 30, and 40). Decoded fields land in a BeiDouB2bData.
Arguments
prn::Int: Pseudo-Random Noise code identifier (1-63 for BeiDou satellites)
Returns
GNSSDecoderState{BeiDouB2bData}: Initialized decoder state for BeiDou B2b
Example
state = BeiDouB2bDecoderState(26) # PRN 26
state = decode(state, soft_symbols, num_symbols)
if is_sat_healthy(state)
# Use state.data for positioning
endSee Also
GNSSDecoderState: The underlying state structuredecode: Decode soft symbols using this statereset_decoder_state: Reset after signal lossis_sat_healthy: Check satellite health status
Decoding
GNSSDecoder.decode — Function
decode(
state::GNSSDecoderState,
soft_symbols::AbstractVector{<:Real},
num_symbols::Int64;
decode_once
) -> GNSSDecoderState
Decode GNSS navigation message soft symbols and update the decoder state.
Processes incoming soft symbols from a GNSS signal, detecting preambles and decoding synchronization sequences to extract navigation data. The function handles both normal and 180-degree phase-shifted signals automatically.
Soft-symbol convention
soft_symbols is an AbstractVector{<:Real}; Float32 is canonical. The sign carries the bit decision and the magnitude carries confidence (standard LLR convention):
- positive ⇒ bit 0, negative ⇒ bit 1 — but treat this as a convention, not a hard input requirement. The absolute polarity of a Costas-tracked signal is inherently 180°-ambiguous, so the decoder does not depend on it: it matches the preamble in either polarity and flips internally (recording the result in
is_shifted_by_180_degrees). Feeding the opposite sign decodes the same data; only the reported polarity flag differs. (Note:Tracking.jl'sget_soft_bitshappens to use the opposite sign — positive ⇒ bit 1 — which is harmless for exactly this reason.) - magnitude ⇒ confidence. No normalization is required; values need not lie in
[-1, 1]. GPS L1 C/A (hard-slice + parity) and Galileo E1B (Viterbi, whose ML path is invariant to a global scale) use the sign and are indifferent to the magnitude scale. The LDPC decodes (GPS L1C-D and the BeiDou B-CNAV family: B1C, B2a, B2b) are flooding sum-product, which is scale-sensitive, so there the magnitudes should be confidence-weighted on a roughly LLR-like scale (≈ 2·r/σ²) for best performance at marginal SNR — but still need not be normalized to a fixed range.
Glue from Tracking.jl: feed get_soft_bits (polarity-corrected, amplitude-weighted soft bits) for every signal. See CONTEXT.md for the full glossary.
Arguments
state::GNSSDecoderState: Current decoder statesoft_symbols::AbstractVector{<:Real}: Soft symbols to consume, oldest firstnum_symbols::Int: Number of leading entries ofsoft_symbolsto process
Keywords
decode_once::Bool=false: Iftrue, stops once all required positioning data has been validated (subframes 1-3 for GPS L1 C/A; word types 1-5 for Galileo E1B)
Returns
GNSSDecoderState: Updated decoder state with newly decoded data
Example
state = GPSL1CADecoderState(1) # PRN 1
state = decode(state, Float32[+1, -1, ...], 8)See Also
GNSSDecoderState: The state structure being updatedis_sat_healthy: Check satellite health after decoding
State Management
GNSSDecoder.reset_decoder_state — Function
reset_decoder_state(
state::GNSSDecoderState{<:GNSSDecoder.GPSL1CAData}
) -> GNSSDecoderState{GNSSDecoder.GPSL1CAData}
Reset the GPS L1 decoder state after a signal loss or reacquisition.
Clears the bit buffers and time-of-week (TOW) field while preserving other decoded ephemeris and clock data in raw_data. This allows faster recovery after brief signal outages without requiring a full re-decode of all subframes.
The trans_week field is intentionally not reset as it is only broadcast in subframe 1. This may cause brief errors if a GPS week rollover occurs during a signal outage.
Arguments
state::GNSSDecoderState{<:GPSL1CAData}: Current GPS L1 decoder state
Returns
GNSSDecoderState{<:GPSL1CAData}: Reset decoder state with cleared buffers
Example
# After detecting signal loss
state = reset_decoder_state(state)
# Continue decoding with preserved ephemeris
state = decode(state, new_bits, num_bits)See Also
# Reset bit buffers and TOW data field, while keeping theGPSL1CADecoderState: Create a fresh decoder state # remaining parameters in raw_data. This allows a GNSSReceiverdecode: Continue decoding after reset # to use a satellite after a reacquisition without waiting for
reset_decoder_state(
state::GNSSDecoderState{<:GNSSDecoder.GalileoE1BData}
) -> GNSSDecoderState{GNSSDecoder.GalileoE1BData}
Reset the Galileo E1B decoder state after a signal loss or reacquisition.
Clears the bit buffers and time-of-week (TOW) field while preserving other decoded ephemeris and clock data in raw_data. This allows faster recovery after brief signal outages without requiring a full re-decode of all pages.
The week number (WN) field is intentionally not reset as it is not broadcast as frequently as TOW. This may cause brief errors if a week rollover occurs during a signal outage.
Arguments
state::GNSSDecoderState{<:GalileoE1BData}: Current Galileo E1B decoder state
Returns
GNSSDecoderState{<:GalileoE1BData}: Reset decoder state with cleared buffers
Example
# After detecting signal loss
state = reset_decoder_state(state)
# Continue decoding with preserved ephemeris
state = decode(state, new_bits, num_bits)See Also
# Reset bit buffers and TOW data field, while keeping theGalileoE1BDecoderState: Create a fresh decoder state # remaining parameters in raw_data. This allows a GNSSReceiverdecode: Continue decoding after reset # to use a satellite after a reacquisition without waiting for
reset_decoder_state(
state::GNSSDecoderState{<:GNSSDecoder.GalileoE5aData}
) -> GNSSDecoderState{GNSSDecoder.GalileoE5aData}
Reset the Galileo E5a decoder state after a signal loss or reacquisition.
Clears the soft-symbol buffer and the time-of-week (TOW) field while preserving other decoded ephemeris and clock data in raw_data, mirroring the E1B reset semantics. The week number (WN) is intentionally not reset (it is broadcast less frequently than TOW).
reset_decoder_state(
state::GNSSDecoderState{<:GPSL1C_DData}
) -> GNSSDecoderState{GPSL1C_DData}
Reset the GPS L1C-D decoder state after a signal loss or reacquisition.
Clears the in-flight sync state (soft-symbol buffer and TOI) and the validated data, while preserving the long-lived CED/clock fields in raw_data so a [GNSSReceiver] can re-use the satellite after reacquisition without re-decoding all of subframe 2. Mirrors the semantics of the GPS L1 C/A and Galileo E1B implementations.
Arguments
state::GNSSDecoderState{<:GPSL1C_DData}: Current GPS L1C-D decoder state.
Returns
GNSSDecoderState{<:GPSL1C_DData}: Reset decoder state with cleared buffers.
See Also
GPSL1C_DDecoderState: Create a fresh decoder statedecode: Continue decoding after reset
reset_decoder_state(
state::GNSSDecoderState{<:GPSCNAVData}
) -> GNSSDecoderState{GPSCNAVData}
Reset a GPS CNAV decoder state after a signal loss or reacquisition.
Clears the soft-symbol buffer and the time-of-week (TOW) field while preserving the remaining decoded ephemeris and clock data in raw_data, so a GNSSReceiver can re-use the satellite after reacquisition without re-decoding all message types. Mirrors the semantics of the GPS L1 C/A and Galileo E1B implementations.
Arguments
state::GNSSDecoderState{<:GPSCNAVData}: Current GPS CNAV decoder state (GPS L5I or L2C — both share the CNAVGPSCNAVData)
Returns
GNSSDecoderState{<:GPSCNAVData}: Reset decoder state with cleared buffers
See Also
GPSL5IDecoderState,GPSL2CMDecoderState: Create a fresh decoder statedecode: Continue decoding after reset
reset_decoder_state(
state::GNSSDecoderState{<:BeiDouDNAVData}
) -> GNSSDecoderState{BeiDouDNAVData, C, GNSSDecoder.BeiDouDNAVCache} where C<:GNSSDecoder.AbstractGNSSConstants
Reset a BeiDou B1I/B3I decoder state after a signal loss or reacquisition.
Clears the soft-symbol buffer, the seconds-of-week field (and its symbol-counter anchor), and the staged D2 pages, while preserving the other decoded parameters in raw_data. This allows faster recovery after brief signal outages without a full re-decode of all subframes.
reset_decoder_state(
state::GNSSDecoderState{<:BeiDouB1CData}
) -> GNSSDecoderState{BeiDouB1CData}
Reset the BeiDou B1C decoder state after a signal loss or reacquisition.
Clears the in-flight sync state (soft-symbol buffer and SOH) and the validated data, while preserving the long-lived ephemeris/clock fields in raw_data so a receiver can re-use the satellite after reacquisition without re-decoding all of subframe 2. Mirrors the GPS L1C-D implementation.
Arguments
state::GNSSDecoderState{<:BeiDouB1CData}: Current BeiDou B1C decoder state.
Returns
GNSSDecoderState{<:BeiDouB1CData}: Reset decoder state with cleared buffers.
See Also
BeiDouB1CDecoderState: Create a fresh decoder statedecode: Continue decoding after reset
reset_decoder_state(
state::GNSSDecoderState{<:BeiDouB2aData}
) -> GNSSDecoderState{BeiDouB2aData}
Reset a BeiDou B2a decoder state after a signal loss or reacquisition.
Clears the soft-symbol buffer and the seconds-of-week field while preserving the remaining decoded ephemeris and clock data in raw_data, so a receiver can re-use the satellite after reacquisition without re-decoding all message types. Mirrors the semantics of the GPS CNAV implementation.
Arguments
state::GNSSDecoderState{<:BeiDouB2aData}: Current BeiDou B2a decoder state
Returns
GNSSDecoderState{<:BeiDouB2aData}: Reset decoder state with cleared buffers
See Also
BeiDouB2aDecoderState: Create a fresh decoder statedecode: Continue decoding after reset
Health Status
GNSSDecoder.is_sat_healthy — Function
is_sat_healthy(
state::GNSSDecoderState{<:GNSSDecoder.GPSL1CAData}
)
Check if the GPS satellite is healthy and usable for positioning.
Examines the 6-bit satellite health field (sv_health) from subframe 1. A satellite is considered healthy only if all health bits are zero ("000000").
This function requires that subframe 1 has been successfully decoded. Check that state.data.sv_health is not nothing before relying on this result.
Arguments
state::GNSSDecoderState{<:GPSL1CAData}: GPS L1 decoder state with decoded data
Returns
Bool:trueif satellite health status indicates normal operation
Example
state = GPSL1CADecoderState(1)
state = decode(state, bits, num_bits)
if is_sat_healthy(state)
# Safe to use for positioning
endSee Also
GPSL1CADecoderState: Create decoder statedecode: Decode navigation data
is_sat_healthy(
state::GNSSDecoderState{<:GNSSDecoder.GalileoE1BData}
)
Check if the Galileo satellite is healthy and usable for positioning.
Examines both the signal health status (signal_health_e1b) and data validity status (data_validity_status_e1b) from page type 5. A satellite is considered healthy only if both conditions are met:
- Signal health is
signal_ok - Data validity is
navigation_data_valid
This function requires that page type 5 has been successfully decoded. Check that state.data.signal_health_e1b is not nothing before relying on this result.
Arguments
state::GNSSDecoderState{<:GalileoE1BData}: Galileo E1B decoder state with decoded data
Returns
Bool:trueif satellite health and data validity indicate normal operation
Example
state = GalileoE1BDecoderState(1)
state = decode(state, bits, num_bits)
if is_sat_healthy(state)
# Safe to use for positioning
endSee Also
GalileoE1BDecoderState: Create decoder statedecode: Decode navigation data
is_sat_healthy(
state::GNSSDecoderState{<:GNSSDecoder.GalileoE5aData}
)
Check if the Galileo satellite is healthy and usable for positioning on E5a.
Examines both the E5a signal-health status (signal_health_e5a) and the E5a data-validity status (data_validity_status_e5a) from word type 1. A satellite is considered healthy only if the signal health is signal_ok and the data validity is navigation_data_valid.
is_sat_healthy(state::GNSSDecoderState{<:GPSL1C_DData})
Check if the GPS L1C-D satellite is healthy and usable for positioning.
Examines the 1-bit L1C signal health flag from subframe 2 (IS-GPS-800G §3.5.3.4): a satellite is healthy iff the health bit is 0 (Signal OK).
Arguments
state::GNSSDecoderState{<:GPSL1C_DData}: GPS L1C-D decoder state.
Returns
Bool:trueiff the L1C signal-health bit indicates OK.
is_sat_healthy(
state::GNSSDecoderState{<:GPSCNAVData, <:GNSSDecoder.GPSCNAVConstants{:GPSL5I}}
) -> Bool
Check if the GPS L5 satellite is healthy and usable for positioning.
Examines the L5 signal health bit decoded from the most recent message type 10 (IS-GPS-705J §20.3.3.1.1.2): a satellite is healthy iff the health bit is 0 (all navigation data on the L5 signal are OK).
Requires message type 10 to have been decoded and the positioning set to have been validated; returns false until then.
Arguments
state::GNSSDecoderState{<:GPSCNAVData,<:GPSL5IConstants}: GPS L5I decoder state.
Returns
Bool:trueiff the L5 signal-health bit indicates OK.
is_sat_healthy(
state::GNSSDecoderState{<:GPSCNAVData, <:GNSSDecoder.GPSCNAVConstants{:GPSL2CM}}
) -> Bool
Check if the GPS L2C satellite is healthy and usable for positioning.
Examines the L2 signal health bit decoded from the most recent message type 10 (IS-GPS-200N §30.3.3.1.1.2): a satellite is healthy iff the L2 health bit is 0 (some or all codes and data on the L2 carrier are OK). This is the only decode-level difference from GPS L5I, which reports the L5 health bit.
Requires message type 10 to have been decoded and the positioning set to have been validated; returns false until then.
Arguments
state::GNSSDecoderState{<:GPSCNAVData,<:GPSL2CMConstants}: GPS L2C decoder state.
Returns
Bool:trueiff the L2 signal-health bit indicates OK.
is_sat_healthy(state::GNSSDecoderState{<:BeiDouDNAVData})
Check if the BeiDou satellite is healthy and usable for positioning, from the legacy D1/D2 navigation message.
Examines the autonomous satellite health flag (SatH1) broadcast in D1 subframe 1 / D2 subframe 1 page 1: 0 means the broadcasting satellite is good, 1 means not (BDS-SIS-ICD-B1I-3.0 / -B3I-1.0 §5.2.4.6).
One method covers both B1I and B3I: the two signals carry the same SatH1 bit of the same message, so unlike GPS L5I and L2CM — which select different health bits out of a shared CNAV container — there is nothing per-signal to dispatch on.
Requires the fundamental navigation data to have been decoded and validated; returns false until then.
Arguments
state::GNSSDecoderState{<:BeiDouDNAVData}: BeiDou B1I or B3I decoder state
Returns
Bool:trueiff SatH1 indicates a healthy satellite
is_sat_healthy(state::GNSSDecoderState{<:BeiDouB1CData})
Check if the BeiDou B1C satellite is healthy and usable for positioning.
Examines the 2-bit satellite health status (HS) broadcast in every subframe-3 page (BDS-SIS-ICD-B1C-1.0 §7.14, Table 7-22): a satellite is healthy iff HS == 0 (the satellite provides services). The B1C integrity status flags (dif/sif/aif, §7.15) are reported separately on BeiDouB1CData and are deliberately not folded in here — they flag message/signal integrity for precision users, not the satellite's service state.
Requires a subframe-3 page to have been decoded and the positioning set validated; returns false until then.
Arguments
state::GNSSDecoderState{<:BeiDouB1CData}: BeiDou B1C decoder state.
Returns
Bool:trueiff the health status word indicates a healthy satellite.
is_sat_healthy(state::GNSSDecoderState{<:BeiDouB2aData})
Check if the BeiDou B2a satellite is healthy and usable for positioning.
Examines the 2-bit satellite health status HS decoded from the most recent message of types 11 or 30-34 or 40 (BDS-SIS-ICD-B2a-1.0 §7.14, Table 7-22): the satellite is healthy iff HS == 0 ("the satellite is healthy / provides services"). HS = 1 means unhealthy or in test; 2-3 are reserved and treated as unhealthy.
Requires a health-carrying message to have been decoded and the positioning set to have been validated; returns false until then.
Arguments
state::GNSSDecoderState{<:BeiDouB2aData}: BeiDou B2a decoder state.
Returns
Bool:trueiff the broadcast health status indicates a usable satellite.
is_sat_healthy(state::GNSSDecoderState{<:BeiDouB2bData})
Check if the BeiDou B2b satellite is healthy and usable for positioning.
Examines the 2-bit satellite health status (HS) decoded from the most recent message type 30 (BDS-SIS-ICD-B2b-1.0 §7.13, Table 7-20): a satellite is healthy iff HS = 0 ("the satellite is healthy / provides services"); 1 means unhealthy or in test, 2-3 are reserved.
Requires message type 30 to have been decoded and the positioning set to have been validated; returns false until then.
Arguments
state::GNSSDecoderState{<:BeiDouB2bData}: BeiDou B2b decoder state.
Returns
Bool:trueiff the health status word indicates a healthy satellite.
Positioning Readiness
Pair is_decoding_completed_for_positioning with is_sat_healthy to gate use of a satellite in a fix: the first confirms the required navigation data set has been decoded and validated, the second that the satellite is broadcasting healthy. See the docstring for what it deliberately does not gate on (ephemeris freshness, second-order corrections, the alert flag).
GNSSDecoder.is_decoding_completed_for_positioning — Function
is_decoding_completed_for_positioning(
state::GNSSDecoderState
) -> Any
Report whether a decoder has recovered the minimum navigation data a positioning engine needs from this satellite: a time of week, a full ephemeris (orbit) set, and the SV clock-correction polynomial (plus, on the signals that carry it in the same required set, the broadcast week number and single-band group delay). Dispatches on the validated data field, so it only becomes true once the required message set has passed CRC/parity and the cross-subframe issue-of-data consistency check that promotes raw_data to data.
This is the readiness gate a receiver (e.g. PositionVelocityTime.jl) should pair with is_sat_healthy: whenever this returns true, the health field is_sat_healthy inspects is guaranteed to have been decoded, so the two can be checked together without a separate nothing guard.
A true here means the data set is complete and self-consistent — it is a necessary condition for using the SV in a fix, not a blanket guarantee that no further judgement is required:
- Ephemeris freshness. Only presence is checked, not age. The decoder has no notion of "now", so the consumer must still reject ephemerides outside their fit interval (
fit_interval/t_oeage). - Second-order corrections. Group delay / inter-signal corrections (
T_GD,ISC_*) beyond the single required band, Klobuchar ionosphere, and UTC parameters are intentionally excluded because they are broadcast far less often; apply them when present and treatnothingas zero rather than waiting for them. - Alert flag.
is_sat_healthyreflects the broadcast health bits only; a receiver that wants to honour the L1 C/A alert flag (or equivalent) must check it separately.
Signal Metadata
A decoder state knows which signal it demodulates, so GNSSSignals' signal accessors are extended for GNSSDecoderState and answer directly from the state — no need to carry the signal alongside the decoder just to ask what it is. Each forwards to the corresponding signal in GNSSSignals through get_signal_type, so every value stays single-sourced, and each folds to a compile-time constant.
| Accessor | Answers | Example (GPSL2CMDecoderState(1)) |
|---|---|---|
get_signal_id / get_signal_name | which signal | :GPSL2CM / "GPS L2CM" |
get_constellation_id / get_constellation_name | which constellation | :GPS / "GPS" |
get_band / get_band_id / get_band_name | which RF band | L2() / :L2 / "L2" |
get_data_frequency | navigation-message symbol rate | 50 Hz |
get_time_system / get_time_system_id / get_time_system_name | time scale the decoded week numbers and times of week are counted in | GPST() / :GPST / "GPS Time" |
get_system_start_time / get_tai_offset | that scale's epoch and offset from TAI — what turns a decoded WN/TOW pair into an absolute instant | 1980-01-06T00:00:00 / 19 s |
Dispatch is on the constants type, which keeps decoders that share a data container distinct: GPS L5-I and L2C-M both decode into a GPSCNAVData but report their own band, ids and symbol rates.
using GNSSDecoder, GNSSSignals
get_data_frequency(GPSL5IDecoderState(1)) # 100 Hz
get_data_frequency(GPSL2CMDecoderState(1)) # 50 Hz
get_signal_name(GalileoE5aDecoderState(1)) # "Galileo E5a-I"
get_band_id(GalileoE1BDecoderState(1)) # :L1 — bands are identified by RF
# frequency, not ICD label
get_system_start_time(GalileoE1BDecoderState(1)) # 1999-08-21T23:59:47Accessors describing the spreading code (get_code_length, get_code_frequency, get_carrier_phase_offset, …) are not forwarded — they belong to acquisition and tracking rather than to a symbol-domain decoder — but remain one step away via get_signal_type:
get_code_length(get_signal_type(GPSL1CADecoderState(1))) # 1023GNSSDecoder.get_signal_type — Function
get_signal_type(state::GNSSDecoderState) -> Type{<:AbstractGNSSSignal}
get_signal_type(constants::AbstractGNSSConstants) -> Type{<:AbstractGNSSSignal}Get the GNSSSignals signal type whose navigation message a decoder demodulates, e.g. GPSL1CA for a GPSL1CADecoderState. This is the single mapping from this package's decoders back into GNSSSignals; every signal accessor listed under "Signal metadata" in the docs is forwarded through it, and it is the entry point for anything not forwarded (get_signal_type(state) accepts every GNSSSignals accessor that takes a signal type).
Returns the type, not an instance: constructing a signal builds its spreading code matrix and SIMD lookup table, which a decoder — working purely in the symbol domain — never needs. Being a type, it also folds to a compile-time constant, so the forwarded accessors cost nothing at run time.
Stated per signal file, dispatched on the constants type rather than the data type, because the constants are what tell apart decoders that share a data container: GPS L5-I and L2C-M both decode into a GPSCNAVData but are distinct signals (GPSCNAVConstants{:GPSL5I} vs GPSCNAVConstants{:GPSL2CM}).
The mapping names the data-bearing component of a signal pair, since that is what carries the navigation message: GPSL2CM (not the GPSL2CL pilot) and GalileoE5aI (not the GalileoE5aQ pilot). A decoder built from an approximation of a signal reports the signal it approximates — the E1B BOC(1,1) decoder state is a GalileoE1B, since the approximation is a tracking/acquisition concern and the I/NAV stream it decodes is identical.
Examples
using GNSSDecoder, GNSSSignals
get_signal_type(GPSL1CADecoderState(1)) # GPSL1CA
get_signal_type(GPSL2CMDecoderState(1)) # GPSL2CM
get_code_length(get_signal_type(GPSL1CADecoderState(1))) # 1023See Also
GNSSDecoderState: The state this is queried from
Shared Utilities
Signal-independent building blocks used across the decoders (CRC-24Q, the BCH(51,8) TOI codec, and the block (de)interleaver).
GNSSDecoder.crc24q — Function
crc24q(bytes::AbstractVector{UInt8}) -> UInt32Compute the CRC-24Q checksum (polynomial 0x1864cfb, init 0, no input or output reflection, xor-out 0) over bytes. The result is right-aligned in the low 24 bits of the returned UInt32; bits 24..31 are always zero.
For a complete CRC-protected message — i.e. a message followed by its big-endian 24-bit checksum — crc24q(message_with_crc) returns 0 iff the checksum matches.
crc24q(bits::AbstractVector{Bool}) -> UInt32Bit-stream variant. bits is interpreted MSB-first in the same direction as the wire (i.e. the first bit of bits enters the CRC register first). length(bits) need not be a multiple of 8 — any leftover bits at the tail are processed bit-by-bit. The CRC field, if appended, must therefore also appear MSB-first as 24 individual bits.
GNSSDecoder.BCHToiSync — Type
BCHToiSync(toi::Int, polarity_flipped::Bool)Result of a successful multi-subframe BCH(51,8) sync. toi is the TOI value of the first of the two subframes that matched. polarity_flipped == true means the receiver is Costas-locked 180° off and every bit must be inverted before downstream processing.
GNSSDecoder.sync_bch_toi — Function
sync_bch_toi(first52, next52) -> Union{BCHToiSync, Nothing}Run the multi-subframe BCH(51,8) match used by GPS L1C-D frame sync. first52 and next52 are 52-symbol windows that, if the receiver is synchronised, hold the BCH-encoded TOI of two consecutive subframes. Both inputs are accepted as either packed UInt64 hard codewords (output of pack_hard_codeword) or anything iterable of length 52 from which a hard codeword can be sliced.
Returns a BCHToiSync for the lowest toi ∈ 0..399 that makes either:
first52 == BCH_TOI_CODEWORDS[toi]andnext52 == BCH_TOI_CODEWORDS[(toi+1) mod 400]— reported aspolarity_flipped == false, or- the bitwise complement of
first52andnext52matching the same pair — reported aspolarity_flipped == true(Costas-lock 180° off).
If neither holds for any TOI, returns nothing.
Note on inherent ambiguity: because the BCH(51,8) construction XORs the 51 LFSR bits with the MSB of the 9-bit TOI, the codeword for t + 256 is the bitwise complement of the codeword for t (whenever both are in range). The receiver therefore cannot tell apart "TOI=t, no flip" from "TOI=t + 256, with flip" for t ∈ 0..143. This function follows PocketSDR's sync_CNV2_frame policy and returns the lowest-TOI match first; downstream code uses an out-of-band check (e.g. the SF2 WN MSB) to break the tie.
This mirrors PocketSDR's sync_CNV2_frame algorithm — see /home/schoenbrod/Code/PocketSDR/python/sdr_nav.py.
GNSSDecoder.soft_to_hard_codeword — Function
soft_to_hard_codeword(soft_symbols) -> UInt64Hard-slice 52 soft symbols (positive ⇒ bit 0, negative ⇒ bit 1; the package-wide convention) into a packed UInt64 codeword.
GNSSDecoder.pack_hard_codeword — Function
pack_hard_codeword(bits) -> UInt64Pack 52 hard-decision symbols (any iterable of Bool-castable values, e.g. Vector{Bool}, Vector{UInt8}, BitVector) into a UInt64 codeword with the first symbol at bit 0. Errors if length(bits) != 52.
GNSSDecoder.deinterleave! — Function
deinterleave!(dst, src, rows, cols) -> dstReverse a rows × cols block interleaver. src is the received (column- major-written, row-major-read) stream; dst receives the original (row-major) stream. Both must satisfy length(dst) == length(src) == rows*cols. dst and src may not alias.
Element type T is preserved — works for Float32 soft symbols, Bool hard slices, Int8, anything.
GNSSDecoder.interleave! — Function
interleave!(dst, src, rows, cols) -> dstForward (transmit-side) block interleaver. Inverse of deinterleave!: write src row-major into a rows × cols matrix, read column-major into dst.
Data Types
Every concrete per-signal data type subtypes the abstract supertype of its constellation, which in turn subtypes AbstractGNSSData. The supertypes carry the facts every signal of a constellation shares (e.g. the Galileo ephemeris/clock completeness checks), stated once via subtype dispatch.
GNSSDecoder.AbstractGPSData — Type
AbstractGPSData <: AbstractGNSSDataAbstract supertype for the decoded navigation data of a signal transmitted by the GPS constellation, e.g. GPSL1CAData, GPSCNAVData.
Its purpose is to carry the constellation-level facts every GPS signal's data shares, so they can be stated once (on the supertype, via subtype dispatch) instead of once per signal. Constellation membership is encoded at the struct definition site — the <: AbstractGPSData line written anyway — so a new GPS signal inherits the shared behaviour with nothing to remember. Genuinely per-signal facts (the subframe/message-type completeness checks, the health-bit selection in is_sat_healthy) stay defined on the concrete data types.
GNSSDecoder.AbstractGalileoData — Type
AbstractGalileoData <: AbstractGNSSDataAbstract supertype for the decoded navigation data of a signal transmitted by the Galileo constellation, e.g. GalileoE1BData, GalileoE5aData.
The Galileo counterpart to AbstractGPSData. It carries the facts every Galileo signal's data shares: is_ephemeris_decoded and is_clock_correction_decoded check the same orbital and clock fields for I/NAV (E1B) and F/NAV (E5a), so they are defined once on this supertype (see src/galileo/galileo.jl) instead of once per signal. The health-status and positioning-readiness checks genuinely differ per signal and stay on the concrete data types.
GNSSDecoder.AbstractBeiDouData — Type
AbstractBeiDouData <: AbstractGNSSDataAbstract supertype for the decoded navigation data of a signal transmitted by the BeiDou constellation, e.g. BeiDouDNAVData (B1I/B3I), BeiDouB1CData, BeiDouB2aData, BeiDouB2bData.
The BeiDou counterpart to AbstractGPSData and AbstractGalileoData: it carries the constellation-level facts every BeiDou signal's data shares, so they can be stated once via subtype dispatch. Genuinely per-signal facts (the message-set completeness checks, the health-flag selection in is_sat_healthy) stay defined on the concrete data types.
GPS L1 C/A
GNSSDecoder.GPSL1CAConstants — Type
GPSL1CAConstantsWGS 84 constants and LNAV message structure parameters for GPS L1 C/A signal decoding.
The physical constants are defined in IS-GPS-200 (Interface Specification) and are used for computing satellite positions and clock corrections from broadcast ephemeris data.
Fields
syncro_sequence_length::Int: Length of synchronization sequence in bits (300 bits = 10 words × 30 bits)preamble::UInt8: TLM word preamble pattern (10001011 binary, 0x8B)preamble_length::Int: Length of preamble in bits (8)word_length::Int: Length of each LNAV word in bits (30)PI::Float64: Mathematical constant π = 3.1415926535898 (IS-GPS-200 Table 20-IV)Ω_dot_e::Float64: WGS 84 Earth rotation rate = 7.2921151467×10⁻⁵ rad/sc::Float64: Speed of light = 2.99792458×10⁸ m/sμ::Float64: WGS 84 Earth gravitational parameter = 3.986005×10¹⁴ m³/s²F::Float64: Relativistic correction constant = -4.442807633×10⁻¹⁰ s/√m
Reference
IS-GPS-200N, Section 20.3.3 and Table 20-IV
GNSSDecoder.GPSL1CAData — Type
GPSL1CADataDecoded GPS L1 C/A LNAV navigation message data.
Contains ephemeris, clock correction, and satellite health parameters decoded from subframes 1, 2, and 3 of the GPS LNAV message. All parameters conform to IS-GPS-200N.
Telemetry and Handover Word (TLM/HOW) Fields
last_subframe_id::Int: ID of the last decoded subframe (1-5)integrity_status_flag::Bool: LNAV data integrity status (0=OK, 1=bad)TOW::Int64: Time of Week at the start of the next subframe (seconds, 0-604794 in steps of 6)alert_flag::Bool: URA may be worse than indicated (0=OK, 1=alert)anti_spoof_flag::Bool: Anti-spoofing mode (0=off, 1=on)num_bits_after_valid_syncro_sequence_after_last_TOW::Int: Symbol-counter value whenTOWwas decoded
Subframe 1 - Clock Correction Parameters
trans_week::Int64: GPS week number (modulo 1024)codeonl2::Int64: Code on L2 channel (0=invalid, 1=P-code, 2=C/A-code, 3=invalid)ura::Float64: User Range Accuracy (meters), derived from URA indexsv_health::String: 6-bit satellite health status ("000000" = healthy)IODC::String: Issue of Data, Clock (10-bit binary string)l2pcode::Bool: L2 P-code data flag (1=LNAV OFF on P-code)T_GD::Float64: L1-L2 group delay correction (seconds)t_0c::Int64: Clock reference time (seconds)a_f0::Float64: Clock bias correction coefficient (seconds)a_f1::Float64: Clock drift correction coefficient (s/s)a_f2::Float64: Clock drift rate correction coefficient (s/s²)
Subframe 2 - Ephemeris Parameters (Part 1)
IODE_Sub_2::String: Issue of Data, Ephemeris from subframe 2 (8-bit binary string)C_rs::Float64: Sine harmonic correction to orbit radius (meters)Δn::Float64: Mean motion difference from computed value (semi-circles/s)M_0::Float64: Mean anomaly at reference time (semi-circles)C_uc::Float64: Cosine harmonic correction to argument of latitude (rad)e::Float64: Eccentricity (dimensionless, range 0-0.03)C_us::Float64: Sine harmonic correction to argument of latitude (rad)sqrt_A::Float64: Square root of semi-major axis (√m)t_0e::Int64: Ephemeris reference time (seconds)fit_interval::Bool: Curve fit interval flag (0=4h, 1=>4h)AODO::Int64: Age of Data Offset for NMCT (seconds)
Subframe 3 - Ephemeris Parameters (Part 2)
C_ic::Float64: Cosine harmonic correction to inclination (rad)Ω_0::Float64: Longitude of ascending node at weekly epoch (semi-circles)C_is::Float64: Sine harmonic correction to inclination (rad)i_0::Float64: Inclination angle at reference time (semi-circles)C_rc::Float64: Cosine harmonic correction to orbit radius (meters)ω::Float64: Argument of perigee (semi-circles)Ω_dot::Float64: Rate of right ascension (semi-circles/s)IODE_Sub_3::String: Issue of Data, Ephemeris from subframe 3 (8-bit binary string)i_dot::Float64: Rate of inclination angle (semi-circles/s)
Reference
IS-GPS-200N, Tables 20-I, 20-II, 20-III, Sections 20.3.3.3-20.3.3.4
Galileo E1B
GNSSDecoder.GalileoE1BConstants — Type
GalileoE1BConstantsGTRF constants and I/NAV message structure parameters for Galileo E1B signal decoding.
The physical constants are defined in the Galileo OS SIS ICD (Open Service Signal-In-Space Interface Control Document) and are used for computing satellite positions and clock corrections from broadcast ephemeris data.
Fields
syncro_sequence_length::Int: Length of synchronization sequence in bits (250 bits per page)preamble::UInt16: Page synchronization pattern (0101100000 binary)preamble_length::Int: Length of preamble in bits (10)PI::Float64: Mathematical constant π = 3.1415926535898 (Galileo OS SIS ICD Table 68)Ω_dot_e::Float64: Mean angular velocity of the Earth = 7.2921151467×10⁻⁵ rad/sc::Float64: Speed of light = 2.99792458×10⁸ m/sμ::Float64: Geocentric gravitational constant = 3.986004418×10¹⁴ m³/s²F::Float64: Relativistic correction constant = -4.442807309×10⁻¹⁰ s/√m
Reference
Galileo OS SIS ICD, Issue 2.2, Table 68
GNSSDecoder.GalileoE1BData — Type
GalileoE1BDataDecoded Galileo E1B I/NAV navigation message data.
Contains ephemeris, clock correction, signal health, group delay, ionospheric correction, GST-UTC and GST-GPS conversion, almanac, and Reduced CED parameters decoded from the Galileo I/NAV message. All parameters conform to the Galileo OS SIS ICD, Issue 2.2.
Galileo System Time (GST) Fields
WN::Int64: Week Number (0-4095)TOW::Int64: Time of Week at message transmission (seconds, 0-604799)
Satellite Identification (Word Type 4)
SVID::Int: Satellite Identifier (1-36 nominal range)
Ephemeris Parameters (Word Types 1-3)
t_0e::Float64: Ephemeris reference time (seconds)M_0::Float64: Mean anomaly at reference time (semi-circles)e::Float64: Eccentricity (dimensionless)sqrt_A::Float64: Square root of semi-major axis (√m)Ω_0::Float64: Longitude of ascending node at weekly epoch (semi-circles)i_0::Float64: Inclination angle at reference time (semi-circles)ω::Float64: Argument of perigee (semi-circles)i_dot::Float64: Rate of change of inclination angle (semi-circles/s)Ω_dot::Float64: Rate of change of right ascension (semi-circles/s)Δn::Float64: Mean motion difference from computed value (semi-circles/s)C_uc::Float64: Cosine harmonic correction to argument of latitude (rad)C_us::Float64: Sine harmonic correction to argument of latitude (rad)C_rc::Float64: Cosine harmonic correction to orbit radius (meters)C_rs::Float64: Sine harmonic correction to orbit radius (meters)C_ic::Float64: Cosine harmonic correction to inclination (rad)C_is::Float64: Sine harmonic correction to inclination (rad)
Signal-In-Space Accuracy (Word Type 3)
SISA_e1_e5b::Int: SISA index for dual frequency E1-E5b (Table 91/92; 255 = NAPA)
Clock Correction Parameters (Word Type 4)
t_0c::Float64: Clock correction reference time (seconds)a_f0::Float64: SV clock bias correction coefficient (seconds)a_f1::Float64: SV clock drift correction coefficient (s/s)a_f2::Float64: SV clock drift rate correction coefficient (s/s²)
Issue of Data (Word Types 1-4)
IOD_nav1::UInt: Issue of Data from word type 1 (10-bit)IOD_nav2::UInt: Issue of Data from word type 2 (10-bit)IOD_nav3::UInt: Issue of Data from word type 3 (10-bit)IOD_nav4::UInt: Issue of Data from word type 4 (10-bit)num_pages_after_last_TOW::Int: Pages decoded since last TOW updatenum_bits_after_valid_syncro_sequence_after_last_TOW::Int: Bits since last TOW sync
Signal Health and Data Validity (Word Type 5)
signal_health_e1b::SignalHealth: E1-B/C signal health status (0=OK, 1=out of service, 2=Extended Operations Mode, 3=in test)signal_health_e5b::SignalHealth: E5b signal health statusdata_validity_status_e1b::DataValidityStatus: E1-B data validity (0=valid, 1=working without guarantee)data_validity_status_e5b::DataValidityStatus: E5b data validity
Broadcast Group Delay (Word Type 5)
broadcast_group_delay_e1_e5a::Float64: E1-E5a group delay correction (seconds)broadcast_group_delay_e1_e5b::Float64: E1-E5b group delay correction (seconds)
Ionospheric Correction (Word Type 5)
a_i0::Float64: Effective Ionisation Level 1st-order coefficient (sfu)a_i1::Float64: Effective Ionisation Level 2nd-order coefficient (sfu/degree)a_i2::Float64: Effective Ionisation Level 3rd-order coefficient (sfu/degree²)iono_storm_flag_region1..5::Bool: Ionospheric Disturbance (storm) flags for regions 1-5
GST-UTC Conversion (Word Type 6)
A_0_utc::Float64: Constant term of polynomial (s)A_1_utc::Float64: 1st-order term of polynomial (s/s)Δt_LS::Int: Leap Second count before leap second adjustment (s)t_0t::Int: UTC data reference Time of Week (s)WN_0t::Int: UTC data reference Week Number (8-bit, modulo 256)WN_LSF::Int: Week Number of leap second adjustment (8-bit, modulo 256)DN::Int: Day Number at end of which leap second becomes effective (1=Sunday … 7=Saturday)Δt_LSF::Int: Leap Second count after leap second adjustment (s)
GST-GPS Conversion / GGTO (Word Type 10)
A_0G::Float64: Constant term of GST-GPS offset polynomial (s)A_1G::Float64: Rate of change of GST-GPS offset (s/s)t_0G::Int: GGTO reference time (s)WN_0G::Int: GGTO reference Week Number (6-bit)
Almanac (Word Types 7-10)
almanacs::Dictionary{Int,GalileoAlmanac}: Decoded almanacs keyed by SVID. Entries are inserted as Galileo broadcasts the almanac chain across word types 7→10. SVIDs not yet seen are absent from the dictionary. In-flight chain partials live in the decoder cache and are flushed here only once a full almanac for an SVID has been assembled with a consistent IODa.
Reduced Clock and Ephemeris Data (Word Type 16)
reduced_ced::GalileoReducedCED: Reduced CED for fast initial fix
Reference
Galileo OS SIS ICD, Issue 2.2, Tables 42-55, 67-87
GNSSDecoder.GalileoAlmanac — Type
GalileoAlmanacAlmanac data for one Galileo satellite.
The almanac provides reduced-precision orbital and clock parameters for predicting satellite positions and selecting satellites for tracking. Differences (Δsqrt_A, δi) are relative to nominal Galileo constellation values (A_nominal = 29600.318 km, i_nominal = 56°). The same record is produced by both the I/NAV decoder (word types 7-10) and the F/NAV decoder (word types 5-6); they differ only in which signal-health facet they populate (see below).
Fields
SVID::Int: Satellite identifier (1-36 nominal range; 0 = unused entry)Δsqrt_A::Float64: Difference of √(semi-major axis) from nominal (√m)e::Float64: Eccentricity (dimensionless)ω::Float64: Argument of perigee (semi-circles)δi::Float64: Inclination delta from nominal (semi-circles)Ω_0::Float64: Longitude of ascending node at weekly epoch (semi-circles)Ω_dot::Float64: Rate of change of right ascension (semi-circles/s)M_0::Float64: Mean anomaly at reference time (semi-circles)a_f0::Float64: Truncated SV clock bias (seconds)a_f1::Float64: Truncated SV clock drift (s/s)signal_health_e5b::SignalHealth: Predicted E5b signal health status (Galileo I/NAV word types 7-10)signal_health_e1b::SignalHealth: Predicted E1-B/C signal health status (Galileo I/NAV word types 7-10)signal_health_e5a::SignalHealth: Predicted E5a signal health status (Galileo F/NAV word types 5-6;nothingfor I/NAV-decoded almanacs)IOD_a::Int: Almanac IODWN_a::Int: Almanac reference Week Numbert_0a::Int: Almanac reference time (seconds)
Reference
Galileo OS SIS ICD, Issue 2.2, Table 86 (I/NAV) and Tables 75-76 (F/NAV)
GNSSDecoder.SignalHealth — Type
SignalHealthGalileo signal health status enumeration.
Indicates the operational status of a Galileo signal component (E1B word type 5, E5a F/NAV word type 1, and the per-satellite almanacs of both).
Values
signal_ok: Signal is operating normally (value 0)signal_out_of_service: Signal is out of service (value 1)signal_in_extended_operations_mode: Signal is in Extended Operations Mode (value 2)signal_component_currently_in_test: Signal component is currently in test (value 3)
Reference
Galileo OS SIS ICD, Issue 2.2, Table 84
GNSSDecoder.DataValidityStatus — Type
DataValidityStatusGalileo navigation data validity status enumeration.
Indicates whether the broadcast navigation data should be trusted for positioning.
Values
navigation_data_valid: Navigation data is valid (value 0)working_without_guarantee: Navigation data is working without guarantee (value 1)
Reference
Galileo OS SIS ICD, Issue 2.2, Table 81
Galileo E5a
GNSSDecoder.GalileoE5aConstants — Type
GalileoE5aConstantsGTRF constants and F/NAV message structure parameters for Galileo E5a signal decoding.
The physical constants are defined in the Galileo OS SIS ICD (Open Service Signal-In-Space Interface Control Document) and are used for computing satellite positions and clock corrections from broadcast ephemeris data.
Fields
syncro_sequence_length::Int: Length of one F/NAV page in channel symbols (500 symbols = 10 s at 50 sps)preamble::UInt16: F/NAV synchronisation pattern (101101110000 binary)preamble_length::Int: Length of the sync pattern in symbols (12)PI::Float64: Mathematical constant π = 3.1415926535898 (Galileo OS SIS ICD Table 68)Ω_dot_e::Float64: Mean angular velocity of the Earth = 7.2921151467×10⁻⁵ rad/sc::Float64: Speed of light = 2.99792458×10⁸ m/sμ::Float64: Geocentric gravitational constant = 3.986004418×10¹⁴ m³/s²F::Float64: Relativistic correction constant = -4.442807309×10⁻¹⁰ s/√m
Reference
Galileo OS SIS ICD, Issue 2.2, §4.2 and Table 68
GNSSDecoder.GalileoE5aData — Type
GalileoE5aDataDecoded Galileo E5a F/NAV navigation message data.
Contains ephemeris, clock correction, signal health, group delay, ionospheric correction, GST-UTC and GST-GPS conversion, and almanac parameters decoded from the Galileo F/NAV message (the data component broadcast on E5a-I). All parameters conform to the Galileo OS SIS ICD, Issue 2.2, §5.1.
Unlike I/NAV (E1B/E5b), F/NAV carries only the E5a signal-health (E5a_HS) and data-validity (E5a_DVS) flags and a single broadcast group delay (BGD(E1, E5a)); there is no Reduced CED and no E5b/E1-B field. Angular quantities are stored in radians (the ICD broadcasts them in semi-circles; the decoder multiplies by π), matching the convention used by GalileoE1BData.
Galileo System Time (GST) Fields
WN::Int64: Week Number (0-4095)TOW::Int64: Time of Week at the start of the page (seconds, 0-604799)
Satellite Identification (Word Type 1)
SVID::Int: Satellite Identifier (1-36 nominal range)
Ephemeris Parameters (Word Types 2-4)
t_0e::Float64: Ephemeris reference time (seconds)M_0::Float64: Mean anomaly at reference time (radians)e::Float64: Eccentricity (dimensionless)sqrt_A::Float64: Square root of semi-major axis (√m)Ω_0::Float64: Longitude of ascending node at weekly epoch (radians)i_0::Float64: Inclination angle at reference time (radians)ω::Float64: Argument of perigee (radians)i_dot::Float64: Rate of change of inclination angle (radians/s)Ω_dot::Float64: Rate of change of right ascension (radians/s)Δn::Float64: Mean motion difference from computed value (radians/s)C_uc::Float64: Cosine harmonic correction to argument of latitude (rad)C_us::Float64: Sine harmonic correction to argument of latitude (rad)C_rc::Float64: Cosine harmonic correction to orbit radius (meters)C_rs::Float64: Sine harmonic correction to orbit radius (meters)C_ic::Float64: Cosine harmonic correction to inclination (rad)C_is::Float64: Sine harmonic correction to inclination (rad)
Signal-In-Space Accuracy (Word Type 1)
SISA_e1_e5a::Int: SISA index for dual frequency E1-E5a (Table 91/92; 255 = NAPA)
Clock Correction Parameters (Word Type 1)
t_0c::Float64: Clock correction reference time (seconds)a_f0::Float64: SV clock bias correction coefficient (seconds)a_f1::Float64: SV clock drift correction coefficient (s/s)a_f2::Float64: SV clock drift rate correction coefficient (s/s²)
Issue of Data (Word Types 1-4)
IOD_nav1::UInt: Issue of Data from word type 1 (10-bit)IOD_nav2::UInt: Issue of Data from word type 2 (10-bit)IOD_nav3::UInt: Issue of Data from word type 3 (10-bit)IOD_nav4::UInt: Issue of Data from word type 4 (10-bit)num_pages_after_last_TOW::Int: Pages decoded since last TOW updatenum_bits_after_valid_syncro_sequence_after_last_TOW::Int: Symbols since last TOW sync
Signal Health and Data Validity (Word Type 1)
signal_health_e5a::SignalHealth: E5a signal health status (0=OK, 1=out of service, 2=Extended Operations Mode, 3=in test)data_validity_status_e5a::DataValidityStatus: E5a data validity (0=valid, 1=working without guarantee)
Broadcast Group Delay (Word Type 1)
broadcast_group_delay_e1_e5a::Float64: E1-E5a group delay correction (seconds)
Ionospheric Correction (Word Type 1)
a_i0::Float64: Effective Ionisation Level 1st-order coefficient (sfu)a_i1::Float64: Effective Ionisation Level 2nd-order coefficient (sfu/degree)a_i2::Float64: Effective Ionisation Level 3rd-order coefficient (sfu/degree²)iono_storm_flag_region1..5::Bool: Ionospheric Disturbance (storm) flags for regions 1-5
GST-UTC Conversion (Word Type 4)
A_0_utc::Float64: Constant term of polynomial (s)A_1_utc::Float64: 1st-order term of polynomial (s/s)Δt_LS::Int: Leap Second count before leap second adjustment (s)t_0t::Int: UTC data reference Time of Week (s)WN_0t::Int: UTC data reference Week Number (8-bit, modulo 256)WN_LSF::Int: Week Number of leap second adjustment (8-bit, modulo 256)DN::Int: Day Number at end of which leap second becomes effective (1=Sunday … 7=Saturday)Δt_LSF::Int: Leap Second count after leap second adjustment (s)
GST-GPS Conversion / GGTO (Word Type 4)
A_0G::Float64: Constant term of GST-GPS offset polynomial (s)A_1G::Float64: Rate of change of GST-GPS offset (s/s)t_0G::Int: GGTO reference time (s)WN_0G::Int: GGTO reference Week Number (6-bit)
Almanac (Word Types 5-6)
almanacs::Dictionary{Int,GalileoAlmanac}: Decoded almanacs keyed by SVID. Galileo broadcasts three almanacs across the word-type-5/6 pair: SVID-1 (full in WT5), SVID-2 (split across WT5 and WT6), and SVID-3 (full in WT6). The in-flight SVID-2 partial lives in the decoder cache and is flushed here only once WT6 completes it with a consistentIOD_a. SVID-3, though fully carried in WT6, inherits its reference epoch (WN_a/t_0a) from the paired WT5; when that partial is missing (mid-stream acquisition or an IOD cutover), the SVID-3 record is still stored withWN_a/t_0aleftnothing— the decoder keeps whatever it can decode rather than discarding it. Because the epoch is shared by every almanac of a givenIOD_a, a later WT5 back-fills it into any such partial record, so a one-shot WT6 orbit becomes usable even if that WT6 never reappears. An almanac may therefore be incomplete: any field can benothing, and in particular a record's reference epoch (WN_a/t_0a) may be absent until a matching WT5 arrives — check the fields you need before using a record. F/NAV almanacs carry the E5a health (signal_health_e5a); the E5b/E1-B almanac-health fields are leftnothing.
Reference
Galileo OS SIS ICD, Issue 2.2, §5.1, Tables 75-80
GPS L1C-D
GNSSDecoder.GPSL1C_DConstants — Type
GPSL1C_DConstantsWGS 84 constants and CNAV-2 message structure parameters for GPS L1C-D decoding.
The frame is modelled through the generic streaming framework: preamble_length is the 52-symbol subframe-1 BCH segment of the next frame retained at the tail of the sync window, and syncro_sequence_length is the 1800-symbol frame that is drained once a subframe is decoded.
Fields
syncro_sequence_length::Int64: Frame length drained after each decoded subframe (1800 symbols)
preamble_length::Int64: Trailing next-frame subframe-1 BCH segment retained for sync (52 symbols)
PI::Float64: Mathematical constant π (IS-GPS-800G)
Ω_dot_e::Float64: WGS 84 Earth rotation rate (rad/s)
c::Float64: Speed of light (m/s)
μ::Float64: WGS 84 Earth gravitational parameter (m³/s²)
F::Float64: Relativistic correction constant (s/√m)
Reference
IS-GPS-800G, Sections 3.2 and 3.5, Table 3.5-1.
GNSSDecoder.GPSL1C_DData — Type
GPSL1C_DDataDecoded GPS L1C-D (CNAV-2) navigation message data.
Holds the subframe-2 clock, ephemeris, and accuracy parameters (IS-GPS-800G Figure 3.5-1 / Table 3.5-1). Subframe-3 page contents are not parsed in this slice (issue #39); only the count of CRC-valid subframe-3 pages received is tracked. Field-naming follows GPSL1CAData: semi-circle quantities are converted to radians on decode (multiplied by π), all Union{Nothing,…} until first decoded.
Sync / timing
toi::Int: Last validated Time-Of-Interval count (0..399), ornothing.ITOW::Int64: Interval time of week — number of two-hour epochs since the start of the week (subframe 2 bits 14-21).WN::Int64: Transmission week number, modulo-8192 (subframe 2 bits 1-13).t_op::Int64: Data predict time of week (seconds).
Health / accuracy
l1c_health::Bool: L1C signal health bit (false = OK, true = bad/unavailable).ura_ed_index::Int64: Ephemeris URA index (signed).ura_ned0_index::Int64,ura_ned1_index::Int64,ura_ned2_index::Int64: Clock URA indices.
Ephemeris (Table 3.5-1)
t_0e::Int64: Ephemeris/clock data reference time of week (seconds).ΔA::Float64: Semi-major axis difference at reference time (meters).A_dot::Float64: Change rate in semi-major axis (m/s).Δn_0::Float64: Mean motion difference from computed value (rad/s).Δn_0_dot::Float64: Rate of mean motion difference (rad/s²).M_0::Float64: Mean anomaly at reference time (rad).e::Float64: Eccentricity (dimensionless).ω::Float64: Argument of perigee (rad).Ω_0::Float64: Reference right ascension angle (rad).i_0::Float64: Inclination angle at reference time (rad).ΔΩ_dot::Float64: Rate of right ascension difference (rad/s).i_dot::Float64: Rate of inclination angle (rad/s).C_is::Float64,C_ic::Float64: Sine/cosine inclination harmonic corrections (rad).C_rs::Float64,C_rc::Float64: Sine/cosine orbit-radius harmonic corrections (m).C_us::Float64,C_uc::Float64: Sine/cosine argument-of-latitude harmonic corrections (rad).
Clock (Table 3.5-1)
t_0c::Int64: Clock data reference time of week (seconds); equalst_0ein CNAV-2.a_f0::Float64,a_f1::Float64,a_f2::Float64: Clock bias / drift / drift-rate.T_GD::Float64: L1/L2 P(Y) inter-signal correction (seconds).ISC_L1CP::Float64,ISC_L1CD::Float64: L1CP / L1CD inter-signal corrections (seconds).
Subframe 3 (IS-GPS-800J §3.5.4 — IRN-IS-800J layout)
Subframe-3 pages are parsed after their CRC passes, dispatching on the 6-bit page number (bits 9-14; bits 1-8 are the transmitting PRN). The IRN-J figures are implemented (page 1 carries ISC fields absent from pre-IRN-J recordings, which are therefore out of scope). num_sf3_pages_received counts every CRC-valid SF3 page regardless of whether its page format is parsed.
Page 1 — UTC + Klobuchar iono + ISC
A0_UTC,A1_UTC,A2_UTC::Float64: UTC polynomial (s, s/s, s/s²).Δt_LS,Δt_LSF::Int64: current/past and future leap-second counts (s).t_ot::Int64: UTC reference time of week (s).WN_ot,WN_LSF::Int64: UTC and leap-second reference week numbers.DN::Int64: leap-second reference day number (1-7).α_0,α_1,α_2,α_3,β_0,β_1,β_2,β_3::Float64: Klobuchar ionospheric coefficients.ISC_L1CA,ISC_L2C,ISC_L5I5,ISC_L5Q5::Float64: inter-signal corrections (s).
Page 2 — GGTO + EOP
A0_GGTO,A1_GGTO,A2_GGTO::Float64: GPS/GNSS time-offset polynomial.t_GGTO::Int64,WN_GGTO::Int64: GGTO reference time/week.GGTO_ID::Int64: GNSS the time offset refers to — 0 none, 1 Galileo, 2 GLONASS, 3-7 reserved. (Named "GNSS ID" in IS-GPS-800 ≤ Rev J; renamed "GGTO ID" by IRN-IS-800J-003.)t_EOP::Int64: EOP reference time of week (s).PM_X,PM_X_dot,PM_Y,PM_Y_dot::Float64: polar-motion values/rates.ΔUT_GPS,ΔUT_GPS_dot::Float64: UT1-GPS (UT1−GPST) difference and rate.
Pages 3/4/5 — keyed dictionaries (nothing until first decoded)
reduced_almanacs::Dictionary{Int,GPSL1C_DReducedAlmanac}(page 3).midi_almanacs::Dictionary{Int,GPSL1C_DMidiAlmanac}(page 4).differential_corrections::Dictionary{Int,GPSL1C_DDifferentialCorrection}(page 5).
Page 6 — Text
text_message::String: 29 ASCII characters (control chars stripped).
Counters
num_sf3_pages_received::Int: Count of CRC-valid subframe-3 pages received.
Reference
IS-GPS-800J, Figures 3.5-1 through 3.5-9 and Tables 3.5-1, 3.5-3 … 3.5-8.
GNSSDecoder.GPSL1C_DReducedAlmanac — Type
GPSL1C_DReducedAlmanacOne satellite's reduced-almanac packet from subframe 3, page 3 (IS-GPS-800J Figure 3.5-9, Table 3.5-6).
The reduced almanac gives a very coarse ephemeris for satellite selection. Each page-3 carries six 33-bit packets; this struct holds one decoded packet plus the page-level almanac reference week/time. A reduced almanac is complete in a single page — there is no IOD-driven multi-page chaining like Galileo's word types 7-10 — so GPSL1C_DData.reduced_almanacs entries are inserted whole, keyed by PRN_a. Reduced and Midi almanacs use separate structs (their field sets barely overlap); they share the Dictionary pattern.
Reference values to apply (Table 3.5-6 footnotes): e = 0, δi = +0.0056 semi-circles (so i₀ = 0.30 sc = 55°), Ω̇ = -2.6e-9 semi-circles/s, A = A_ref + δA with A_ref = 26 559 710 m, Φ₀ = M₀ + ω. Semi-circle fields are converted to radians on decode.
Fields
PRN_a::Int: Almanac satellite PRN (1-63; 0 marks an empty packet).WN_a::Int: Almanac reference week number (mod 8192).t_oa::Int: Almanac reference time of week (seconds).δA::Float64: Semi-major-axis delta fromA_ref(meters).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).Φ_0::Float64: Argument of latitude at reference time,M₀+ω(rad).l1_health::Bool,l2_health::Bool,l5_health::Bool: per-band health (false = OK, true = some/all signals bad).
Reference
IS-GPS-800J, Figure 3.5-4 / Figure 3.5-9 / Table 3.5-6.
GNSSDecoder.GPSL1C_DMidiAlmanac — Type
GPSL1C_DMidiAlmanacOne satellite's Midi almanac from subframe 3, page 4 (IS-GPS-800J Figure 3.5-5, Table 3.5-7).
The Midi almanac is a medium-precision single-SV almanac. Each page-4 carries exactly one SV's almanac, complete in that single page (no multi-page chaining), so GPSL1C_DData.midi_almanacs entries are inserted whole, keyed by PRN_a. Inclination is δi relative to i₀ = 0.30 semi-circles (55°); semi-circle fields are converted to radians on decode.
Fields
PRN_a::Int: Almanac satellite PRN.WN_a::Int: Almanac reference week number (mod 8192).t_oa::Int: Almanac reference time of week (seconds).e::Float64: Eccentricity (dimensionless).δi::Float64: Inclination delta fromi₀ = 0.30 sc(rad); add the reference.Ω_dot::Float64: Rate of right ascension (rad/s).sqrt_A::Float64: Square root of the semi-major axis (√m).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).ω::Float64: Argument of perigee (rad).M_0::Float64: Mean anomaly at reference time (rad).a_f0::Float64,a_f1::Float64: Clock bias / drift (s, s/s).l1_health::Bool,l2_health::Bool,l5_health::Bool: per-band health.
Reference
IS-GPS-800J, Figure 3.5-5 / Table 3.5-7.
GNSSDecoder.GPSL1C_DDifferentialCorrection — Type
GPSL1C_DDifferentialCorrectionOne satellite's clock+ephemeris differential-correction packet from subframe 3, page 5 (IS-GPS-800J Figure 3.5-6 / Figure 3.5-10 / Table 3.5-8).
A page-5 carries the predict/reference times plus exactly one DC packet (a 34-bit CDC segment and a 92-bit EDC segment that form an indivisible pair) for another SV, keyed by PRN_a. An all-ones PRN ID (0xFF = 255) in any PRN ID field marks an empty packet — the remainder of the data block is then filler (IS-GPS-800G §3.5.4.4.4.1). dc_data_type selects the data the corrections apply to: false ⇒ CNAV-2 (D_L1C), true ⇒ legacy NAV (D). Semi-circle fields → radians.
Fields
PRN_a::Int: PRN the corrections apply to.t_op_D::Int: DC data predict time of week (seconds).t_OD::Int: Time of DC data (seconds).dc_data_type::Bool: false ⇒ CNAV-2, true ⇒ legacy NAV.δa_f0::Float64,δa_f1::Float64: Clock bias / drift corrections (s, s/s).UDRA_index::Int,UDRA_dot_index::Int: (rate-of-)UDRA indices (signed).Δα::Float64,Δβ::Float64: Ephemeris α/β corrections (dimensionless).Δγ::Float64: Ephemeris γ correction (rad).Δi::Float64,ΔΩ::Float64: Inclination / right-ascension corrections (rad).ΔA::Float64: Semi-major-axis correction (meters).
Reference
IS-GPS-800J, Figure 3.5-6 / Figure 3.5-10 / Table 3.5-8.
GPS CNAV (shared by L5I and L2C)
GPS L5I and GPS L2C carry the identical CNAV message, so they share the decoded GPSCNAVData container (and its almanac/correction records) and one constants struct, GPSCNAVConstants. The per-signal constants are type aliases that fix its signal tag; they differ only in which signal-health bit is_sat_healthy reports.
GNSSDecoder.GPSCNAVConstants — Type
GPSCNAVConstants{S} <: AbstractGNSSConstantsWGS 84 constants and CNAV message structure parameters shared by the GPS CNAV signals. The CNAV message is identical on GPS L5I and GPS L2C, so the field values are identical too; the phantom signal tag S (:GPSL5I / :GPSL2CM) exists only so is_sat_healthy can dispatch on the signal (L5I reports the L5 health bit, L2C the L2 health bit). The per-signal aliases GPSL5IConstants and GPSL2CMConstants fix S.
The message is modelled through the generic streaming framework: syncro_sequence_length is the 600-symbol message that is drained once decoded, and preamble_length is the 16-symbol encoding of the next message's preamble retained at the tail of the sync window.
Fields
syncro_sequence_length::Int64: Message length drained after each decoded message (600 symbols)
preamble_length::Int64: Trailing next-message preamble segment retained for sync (16 symbols)
PI::Float64: Mathematical constant π (IS-GPS-705J Table 20-II / IS-GPS-200N §30.3.3)
Ω_dot_e::Float64: WGS 84 Earth rotation rate (rad/s)
c::Float64: Speed of light (m/s)
μ::Float64: WGS 84 Earth gravitational parameter (m³/s²)
F::Float64: Relativistic correction constant (s/√m)
Reference
IS-GPS-705J §20.3.3 / §20.3.4.3 (L5I) ≡ IS-GPS-200N §30.3.2 / §3.3.3.1 (L2C).
GNSSDecoder.GPSL5IConstants — Type
GPSL5IConstantsGPS L5I specialization of GPSCNAVConstants (GPSCNAVConstants{:GPSL5I}). Same field values as the GPS L2C constants — the distinct tag only selects the L5 health bit in is_sat_healthy. Reference: IS-GPS-705J §20.3.3 / §20.3.4.3.
GNSSDecoder.GPSL2CMConstants — Type
GPSL2CMConstantsGPS L2C specialization of GPSCNAVConstants (GPSCNAVConstants{:GPSL2CM}). Same field values as the GPS L5I constants — the CNAV message is identical on both signals; the distinct tag only selects the L2 health bit in is_sat_healthy. The data-bearing L2C component is the L2 CM code (GPSL2CM); the L2 CL code is a dataless pilot. Reference: IS-GPS-200N §30.3.2 / §3.3.3.1.
GNSSDecoder.GPSCNAVData — Type
GPSCNAVDataDecoded GPS CNAV navigation message data, shared by GPS L5I and GPS L2C (the CNAV message is identical on both signals).
Holds the parameters decoded from CNAV message types 10, 11, 12, 13, 14, 15, 30-37, and 40 (IS-GPS-705J §20.3.3 ≡ IS-GPS-200N §30.3.3). The decoder fills fields incrementally as the corresponding message types are received. Field-naming follows GPSL1C_DData (CNAV-2 broadcasts nearly the same parameter set): semi-circle quantities are converted to radians on decode (multiplied by π), all Union{Nothing,…} until first decoded.
Header (every message)
last_message_id::Int: Most recently decoded message type (0 until then).TOW::Int64: SV time in seconds at the start of the next message (message TOW count × 6; the next message is 6 s away on L5I, 12 s on L2C).alert_flag::Bool: Raised when the signal URA may be worse than indicated.
Health / accuracy (message types 10, 30-37)
l1_health::Bool,l2_health::Bool,l5_health::Bool: per-band signal health (false = OK).ura_ed_index::Int64: Ephemeris URA index (signed).ura_ned0_index::Int64,ura_ned1_index::Int64,ura_ned2_index::Int64: Clock URA indices.
Ephemeris (message types 10 + 11, Table 20-I)
WN::Int64: Transmission week number, modulo-8192.t_op::Int64: Data predict time of week (seconds).t_0e::Int64: Ephemeris data reference time of week (seconds).ΔA::Float64: Semi-major axis difference at reference time (meters).A_dot::Float64: Change rate in semi-major axis (m/s).Δn_0::Float64: Mean motion difference from computed value (rad/s).Δn_0_dot::Float64: Rate of mean motion difference (rad/s²).M_0::Float64: Mean anomaly at reference time (rad).e::Float64: Eccentricity (dimensionless).ω::Float64: Argument of perigee (rad).Ω_0::Float64: Reference right ascension angle (rad).i_0::Float64: Inclination angle at reference time (rad).ΔΩ_dot::Float64: Rate of right ascension difference (rad/s).i_dot::Float64: Rate of inclination angle (rad/s).C_is::Float64,C_ic::Float64: Sine/cosine inclination harmonic corrections (rad).C_rs::Float64,C_rc::Float64: Sine/cosine orbit-radius harmonic corrections (m).C_us::Float64,C_uc::Float64: Sine/cosine argument-of-latitude harmonic corrections (rad).integrity_status_flag::Bool,l2c_phasing::Bool: message type 10 flags.
Clock (message types 30-37, Table 20-III)
t_0c::Int64: Clock data reference time of week (seconds).a_f0::Float64,a_f1::Float64,a_f2::Float64: Clock bias / drift / drift-rate.
Group delay / ISC + ionosphere (message type 30, Tables 20-III / 20-IV)
These fields are carried only by message type 30, which is broadcast far less often than the clock/ephemeris (max interval 288 s on L2C / 144 s on L5, vs 48 s / 24 s — IS-GPS-200 Table 30-XII, IS-GPS-705J Table 20-XII). They may therefore still be nothing even once positioning is otherwise ready: is_decoding_completed_for_positioning deliberately does not wait for them, so code that applies these corrections must handle nothing (treat as 0).
T_GD::Float64: L1/L2 P(Y) inter-signal correction (seconds).ISC_L1CA,ISC_L2C,ISC_L5I5,ISC_L5Q5::Float64: inter-signal corrections (s).α_0,α_1,α_2,α_3,β_0,β_1,β_2,β_3::Float64: Klobuchar ionospheric coefficients.WN_op::Int64: Data predict week number (mod 256).
EOP (message type 32, Table 20-VII)
t_EOP::Int64: EOP reference time of week (s).PM_X,PM_X_dot,PM_Y,PM_Y_dot::Float64: polar-motion values/rates (arcsec, arcsec/day).ΔUT_GPS,ΔUT_GPS_dot::Float64: UT1-GPS difference (s) and rate (s/day).
UTC (message type 33, Table 20-IX)
A0_UTC,A1_UTC,A2_UTC::Float64: UTC polynomial (s, s/s, s/s²).Δt_LS,Δt_LSF::Int64: current/past and future leap-second counts (s).t_ot::Int64: UTC reference time of week (s).WN_ot,WN_LSF::Int64: UTC and leap-second reference week numbers.DN::Int64: leap-second reference day number (1-7).
GGTO (message type 35, Table 20-XI)
A0_GGTO,A1_GGTO,A2_GGTO::Float64: GPS/GNSS time-offset polynomial.t_GGTO::Int64,WN_GGTO::Int64: GGTO reference time/week.GNSS_ID::Int64: 0 none, 1 Galileo, 2 GLONASS, 3 BeiDou, 4-7 reserved.
Almanacs / corrections / text — keyed dictionaries (nothing until first decoded)
reduced_almanacs::Dictionary{Int,GPSCNAVReducedAlmanac}(message types 12, 31).midi_almanacs::Dictionary{Int,GPSCNAVMidiAlmanac}(message type 37).clock_corrections::Dictionary{Int,GPSCNAVClockDifferentialCorrection}(message types 13, 34).ephemeris_corrections::Dictionary{Int,GPSCNAVEphemerisDifferentialCorrection}(message types 14, 34).text_mt15::String,text_page_mt15::Int64: message type 15 text page (29 ASCII characters, control chars stripped).text_mt36::String,text_page_mt36::Int64: message type 36 text page (18 ASCII characters).ism::GPSCNAVIntegritySupportMessage: message type 40 Integrity Support Message.
Reference
IS-GPS-705J, Figures 20-1 through 20-17 and Tables 20-I through 20-XIa.
GNSSDecoder.GPSCNAVReducedAlmanac — Type
GPSCNAVReducedAlmanacOne satellite's reduced-almanac packet from CNAV message types 12 or 31 (IS-GPS-705J Figure 20-16, Table 20-VI).
The reduced almanac gives a very coarse ephemeris for satellite selection. Message type 12 carries seven 31-bit packets, message type 31 four; each packet is complete in itself, so GPSCNAVData.reduced_almanacs entries are inserted whole, keyed by PRN_a (mirrors GPSL1C_DReducedAlmanac).
Reference values to apply (Table 20-VI footnotes): e = 0, δi = +0.0056 semi-circles (so i = 55°), Ω̇ = -2.6e-9 semi-circles/s, A = A_ref + δA with A_ref = 26 559 710 m, Φ₀ = M₀ + ω. Semi-circle fields are converted to radians on decode.
Fields
PRN_a::Int: Almanac satellite PRN (1-63; 0 marks an empty packet).WN_a::Int: Almanac reference week number (mod 8192).t_oa::Int: Almanac reference time of week (seconds).δA::Float64: Semi-major-axis delta fromA_ref(meters).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).Φ_0::Float64: Argument of latitude at reference time,M₀+ω(rad).l1_health::Bool,l2_health::Bool,l5_health::Bool: per-band health (false = OK, true = some/all signals bad).
Reference
IS-GPS-705J, Figures 20-4 / 20-11 / 20-16, Table 20-VI.
GNSSDecoder.GPSCNAVMidiAlmanac — Type
GPSCNAVMidiAlmanacOne satellite's Midi almanac from CNAV message type 37 (IS-GPS-705J Figure 20-10, Table 20-V).
The Midi almanac is a medium-precision single-SV almanac, complete in a single message, so GPSCNAVData.midi_almanacs entries are inserted whole, keyed by PRN_a (mirrors GPSL1C_DMidiAlmanac). Inclination is δi relative to i₀ = 0.30 semi-circles (54°); semi-circle fields are converted to radians on decode.
Fields
PRN_a::Int: Almanac satellite PRN.WN_a::Int: Almanac reference week number (mod 8192).t_oa::Int: Almanac reference time of week (seconds).e::Float64: Eccentricity (dimensionless).δi::Float64: Inclination delta fromi₀ = 0.30 sc(rad); add the reference.Ω_dot::Float64: Rate of right ascension (rad/s).sqrt_A::Float64: Square root of the semi-major axis (√m).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).ω::Float64: Argument of perigee (rad).M_0::Float64: Mean anomaly at reference time (rad).a_f0::Float64,a_f1::Float64: Clock bias / drift (s, s/s).l1_health::Bool,l2_health::Bool,l5_health::Bool: per-band health.
Reference
IS-GPS-705J, Figure 20-10, Table 20-V.
GNSSDecoder.GPSCNAVClockDifferentialCorrection — Type
GPSCNAVClockDifferentialCorrectionOne satellite's clock differential-correction (CDC) packet from CNAV message types 13 or 34, keyed by PRN_a (IS-GPS-705J Figure 20-17, Table 20-X).
dc_data_type selects the data the corrections apply to: false ⇒ CNAV (message types 30-37), true ⇒ legacy NAV. A PRN ID of all-ones marks an empty packet (not stored).
Fields
PRN_a::Int: PRN the corrections apply to.t_op_D::Int: DC data predict time of week (seconds).t_OD::Int: Time of DC data (seconds).dc_data_type::Bool: false ⇒ CNAV, true ⇒ legacy NAV.δa_f0::Float64,δa_f1::Float64: Clock bias / drift corrections (s, s/s).UDRA_index::Int: UDRA index (signed).
Reference
IS-GPS-705J, Figures 20-7 / 20-12 / 20-17, Table 20-X.
GNSSDecoder.GPSCNAVEphemerisDifferentialCorrection — Type
GPSCNAVEphemerisDifferentialCorrectionOne satellite's ephemeris differential-correction (EDC) packet from CNAV message types 14 or 34, keyed by PRN_a (IS-GPS-705J Figure 20-17, Table 20-X). Semi-circle fields are converted to radians on decode.
Fields
PRN_a::Int: PRN the corrections apply to.t_op_D::Int: DC data predict time of week (seconds).t_OD::Int: Time of DC data (seconds).dc_data_type::Bool: false ⇒ CNAV, true ⇒ legacy NAV.Δα::Float64,Δβ::Float64: Ephemeris α/β corrections (dimensionless).Δγ::Float64: Ephemeris γ correction (rad).Δi::Float64,ΔΩ::Float64: Inclination / right-ascension corrections (rad).ΔA::Float64: Semi-major-axis correction (meters).UDRA_dot_index::Int: Rate-of-UDRA index (signed).
Reference
IS-GPS-705J, Figures 20-7 / 20-13 / 20-17, Table 20-X.
GNSSDecoder.GPSCNAVIntegritySupportMessage — Type
GPSCNAVIntegritySupportMessageIntegrity Support Message from CNAV message type 40 (ARAIM), complete in a single message (IS-GPS-705J Figure 20-14a, Table 20-XIa).
Fields
GNSS_ID::Int: GNSS identifier the ISM applies to.WN_ISM::Int,TOW_ISM::Int: ISM reference week / time-of-week counts.t_correl::Int,b_nom::Int,γ_nom::Int,R_sat::Int,P_const::Int,MFD::Int,service_level::Int: encoded ARAIM parameter indices.mask::UInt64: 63-bit SV mask (MSB = PRN 1).
Reference
IS-GPS-705J, Figure 20-14a, Table 20-XIa.
BeiDou D1/D2 NAV (shared by B1I and B3I)
BeiDou B1I and B3I carry the identical legacy navigation message — D1 NAV on MEO/IGSO satellites, D2 NAV on GEO satellites, selected by PRN — so they share the decoded BeiDouDNAVData container and one constants struct, BeiDouDNAVConstants. The per-signal constants are type aliases that fix its signal tag, mirroring GPS CNAV.
GNSSDecoder.BeiDouDNAVConstants — Type
BeiDouDNAVConstants{S}BDCS constants and D1/D2 NAV message structure parameters for the BeiDou B1I/B3I legacy signals, parameterized on the signal tag S (:BeiDouB1I or :BeiDouB3I) like GPSCNAVConstants. The distinct tag selects the signal identity (get_signal_type) — the message structure and all constants are identical on both signals (BDS-SIS-ICD-B3I-1.0 §5 mirrors BDS-SIS-ICD-B1I-3.0 §5).
Fields
syncro_sequence_length::Int: Length of one subframe in bits (300)preamble::UInt16: 11-bit preamble11100010010(modified Barker code, §5.2.4.1)preamble_length::Int: Length of preamble in bits (11)word_length::Int: Length of each word in bits (30)PI::Float64: π = 3.1415926535898 (BDS-SIS-ICD-B1I-3.0 Table 5-11)Ω_dot_e::Float64: BDCS Earth rotation rate = 7.2921150×10⁻⁵ rad/s (differs from WGS-84!)c::Float64: Speed of light = 2.99792458×10⁸ m/sμ::Float64: BDCS geocentric gravitational constant = 3.986004418×10¹⁴ m³/s²F::Float64: Relativistic correction constant −2√μ/c² = -4.442807309×10⁻¹⁰ s/√m (§5.2.4.9)
Reference
BDS-SIS-ICD-B1I-3.0, §5.1-§5.3 and Tables 5-7, 5-10, 5-11
GNSSDecoder.BeiDouB1IConstants — Type
BeiDouB1IConstantsBeiDou B1I specialization of BeiDouDNAVConstants (BeiDouDNAVConstants{:BeiDouB1I}). Same field values as the B3I constants — the legacy D1/D2 message is identical on both signals; the distinct tag only selects the signal identity reported by get_signal_type. Reference: BDS-SIS-ICD-B1I-3.0 §5.
GNSSDecoder.BeiDouB3IConstants — Type
BeiDouB3IConstantsBeiDou B3I specialization of BeiDouDNAVConstants (BeiDouDNAVConstants{:BeiDouB3I}). Same field values as the B1I constants — the legacy D1/D2 message is identical on both signals; the distinct tag only selects the signal identity reported by get_signal_type. Reference: BDS-SIS-ICD-B3I-1.0 §5.
GNSSDecoder.BeiDouDNAVData — Type
BeiDouDNAVDataDecoded BeiDou D1/D2 legacy navigation message data, shared by the B1I and B3I decoders (the broadcast message is structurally identical on both signals; see src/beidou/b1i.jl for the group-delay semantics that differ).
All parameters conform to BDS-SIS-ICD-B1I-3.0 §5.2 (D1) / §5.3 (D2). Angles broadcast in semicircles are stored in radians (scaled by the ICD π); times are in seconds of BeiDou Time (BDT).
Frame Fields
last_subframe_id::Int: FraID of the last decoded subframe (1-5)SOW::Int64: Seconds of week at the leading edge of the current subframe's preamble (D1) or of subframe 1 of the current frame (D2), §5.2.4.3/§5.3.3.1num_bits_after_valid_syncro_sequence_after_last_SOW::Int: Symbol-counter value whenSOWwas decoded (drives the SOW plausibility screen)
Subframe 1 (D1) / Subframe 1 Pages 1-2 (D2) - Clock, Health, Iono
sat_h1::Bool: Autonomous satellite health flag (0 = good, §5.2.4.6)AODC::Int64: Age of data, clock (§5.2.4.8)urai::Int64: User range accuracy index (0-15, §5.2.4.5)ura::Float64: User range accuracy (m);nothingwhile URAI = 15 (no prediction)WN::Int64: BDT week number (0-8191, weeks since 2006-01-01, §5.2.4.4)t_0c::Int64: Clock correction reference time (s, scale 2³)a_0::Float64: Clock bias (s, scale 2⁻³³)a_1::Float64: Clock rate (s/s, scale 2⁻⁵⁰)a_2::Float64: Clock drift rate (s/s², scale 2⁻⁶⁶)T_GD1::Float64: B1I equipment group delay differential (s, broadcast in 0.1 ns)T_GD2::Float64: B2I equipment group delay differential (s, broadcast in 0.1 ns)α_0..α_3, β_0..β_3::Float64: Klobuchar ionospheric model parameters (§5.2.4.7)AODE::Int64: Age of data, ephemeris (§5.2.4.11)
Subframes 2-3 (D1) / Subframe 1 Pages 3-10 (D2) - Ephemeris
t_0e::Int64: Ephemeris reference time (s, scale 2³; split across subframes 2 and 3 in D1 — assembled once both parts are present)sqrt_A::Float64: Square root of semi-major axis (√m, scale 2⁻¹⁹)e::Float64: Eccentricity (scale 2⁻³³)ω::Float64: Argument of perigee (rad)Δn::Float64: Mean motion difference (rad/s)M_0::Float64: Mean anomaly at reference time (rad)Ω_0::Float64: Longitude of ascending node at weekly epoch (rad)Ω_dot::Float64: Rate of right ascension (rad/s)i_0::Float64: Inclination at reference time (rad)i_dot::Float64: Rate of inclination (IDOT, rad/s)C_uc, C_us::Float64: Harmonic corrections to argument of latitude (rad, scale 2⁻³¹)C_rc, C_rs::Float64: Harmonic corrections to orbit radius (m, scale 2⁻⁶)C_ic, C_is::Float64: Harmonic corrections to inclination (rad, scale 2⁻³¹)
D1 Subframes 4-5 - Almanac, Health, Time Offsets
almanac::Dictionary{Int,BeiDouDNAVAlmanac}: Per-SVID almanac (SV 1-30, plus SV 31-63 when the expanded almanac is broadcast)health::Dictionary{Int,UInt16}: Per-SVID 9-bit satellite health information words (Table 5-16; 0 = fully healthy)AmEpID::Int64: Identification of expanded almanacs (§5.2.4.14)WN_a::Int64: Almanac week number (modulo 256, §5.2.4.16)t_oa::Int64: Almanac reference time from subframe 5 page 8 (s, scale 2¹²)A_0GPS, A_1GPS::Float64: BDT-GPS time offset (s, s/s; §5.2.4.19, not broadcast temporarily)A_0Gal, A_1Gal::Float64: BDT-Galileo time offset (s, s/s; §5.2.4.20)A_0GLO, A_1GLO::Float64: BDT-GLONASS time offset (s, s/s; §5.2.4.21)A_0UTC, A_1UTC::Float64: BDT-UTC offset polynomial (s, s/s; §5.2.4.18)Δt_LS, Δt_LSF::Int64: Leap seconds before/after the new leap second (s)WN_LSF, DN::Int64: Week number and day number of the new leap second
Reference
BDS-SIS-ICD-B1I-3.0 §5.2.4, §5.3.3 (and identically BDS-SIS-ICD-B3I-1.0 §5)
GNSSDecoder.BeiDouDNAVAlmanac — Type
BeiDouDNAVAlmanacAlmanac data for one BeiDou satellite, decoded from a single D1 almanac page (subframe 4 pages 1-24 for SV 1-24, subframe 5 pages 1-6 for SV 25-30, and — when the expanded-almanac identification AmEpID is 11 — subframe 5 pages 11-23 for SV 31-63 by time sharing, BDS-SIS-ICD-B1I-3.0 §5.2.4.13-§5.2.4.15).
Angles are stored in radians (the broadcast semicircle values scaled by the ICD's π). The reference inclination the broadcast δi corrects is i₀ = 0.3 semicircles for MEO/IGSO satellites and i₀ = 0 for GEO (Table 5-15 note).
Fields
sqrt_A::Float64: Square root of semi-major axis (√m)a_0::Float64: Satellite clock bias (s)a_1::Float64: Satellite clock rate (s/s)Ω_0::Float64: Longitude of ascending node at reference time (rad)e::Float64: Eccentricity (dimensionless)δi::Float64: Correction of orbit reference inclination at reference time (rad)t_oa::Int: Almanac reference time (s, scale 2¹²), from this pageΩ_dot::Float64: Rate of right ascension (rad/s)ω::Float64: Argument of perigee (rad)M_0::Float64: Mean anomaly at reference time (rad)WN_a::Int64: Almanac reference week in force when this page was decoded, ornothingif subframe 5 page 8 had not been seen yet
t_oa and WN_a here belong to this entry, and BeiDouDNAVData also carries a t_oa/WN_a pair — the global one most recently broadcast in subframe 5 page 8. The almanac cycle is 24 pages spread over 12 minutes, so the two can disagree across an almanac changeover; pairing an entry with the global epoch would then propagate the wrong reference time. Prefer the entry's own fields, as BeiDouReducedAlmanac forces by construction.
Reference
BDS-SIS-ICD-B1I-3.0, Tables 5-12 and 5-14
BeiDou B1C
GNSSDecoder.BeiDouB1CConstants — Type
BeiDouB1CConstantsBDCS constants and B-CNAV1 message structure parameters for BeiDou B1C decoding.
The frame is modelled through the generic streaming framework: preamble_length is the 72-symbol subframe-1 BCH segment of the next frame retained at the tail of the sync window, and syncro_sequence_length is the 1800-symbol frame that is drained once a frame is decoded.
Fields
syncro_sequence_length::Int64: Frame length drained after each decoded frame (1800 symbols)
preamble_length::Int64: Trailing next-frame subframe-1 BCH segment retained for sync (72 symbols)
PI::Float64: Mathematical constant π (BDS-SIS-ICD-B1C-1.0 Table 7-9)
Ω_dot_e::Float64: BDCS Earth rotation rate (rad/s) — differs from the WGS-84 value
c::Float64: Speed of light (m/s)
μ::Float64: BDCS Earth gravitational parameter (m³/s²)
F::Float64: Relativistic correction constant F = -2√μ/c² (s/√m, ICD §7.5.2)
Reference
BDS-SIS-ICD-B1C-1.0, Sections 6.2 and 7.5-7.7 (Tables 7-8, 7-9).
GNSSDecoder.BeiDouB1CData — Type
BeiDouB1CDataDecoded BeiDou B1C (B-CNAV1) navigation message data.
Holds the subframe-2 system time, ephemeris, clock, and group-delay parameters (BDS-SIS-ICD-B1C-1.0 Figure 6-6, Tables 7-5 .. 7-8) plus the paged subframe-3 contents (Figures 6-8 .. 6-11). Semi-circle quantities are converted to radians on decode (multiplied by π); all fields are Union{Nothing,…} until first decoded.
Sync / timing (ICD §7.3)
soh::Int: Last validated Seconds-Of-Hour count (0..199, in 18 s units); the epoch it denotes is the leading edge of the current frame's subframe 1. Seconds of week at that epoch =HOW·3600 + soh·18.HOW::Int64: Hours of week (0..167, subframe 2).WN::Int64: BDT week number (0..8191, subframe 2).
Issue of data (ICD §7.4)
IODC::Int64: Issue of data, clock (10 bits).IODE::Int64: Issue of data, ephemeris (8 bits; consistent with the 8 LSBs ofIODCinside one CRC-protected subframe 2).
Ephemeris (Figure 6-12/6-13, Table 7-8)
t_oe::Int64: Ephemeris reference time of week (seconds).sat_type::Int64: Satellite orbit type (raw 2 bits: 1 GEO, 2 IGSO, 3 MEO, 0 reserved). Selects the semi-major-axis referenceA_ref = 27 906 100 m(MEO) or42 162 200 m(IGSO/GEO).ΔA::Float64: Semi-major axis difference at reference time (meters).A_dot::Float64: Change rate in semi-major axis (m/s).Δn_0::Float64: Mean motion difference at reference time (rad/s).Δn_0_dot::Float64: Rate of mean motion difference (rad/s²).M_0::Float64: Mean anomaly at reference time (rad).e::Float64: Eccentricity (dimensionless).ω::Float64: Argument of perigee (rad).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).i_0::Float64: Inclination angle at reference time (rad).Ω_dot::Float64: Rate of right ascension (rad/s).i_dot::Float64: Rate of inclination angle (rad/s).C_is::Float64,C_ic::Float64: Sine/cosine inclination harmonic corrections (rad).C_rs::Float64,C_rc::Float64: Sine/cosine orbit-radius harmonic corrections (m).C_us::Float64,C_uc::Float64: Sine/cosine argument-of-latitude harmonic corrections (rad).
Clock and group delay (Figure 6-14, Tables 7-5, 7-6)
t_oc::Int64: Clock reference time of week (seconds).a_0::Float64,a_1::Float64,a_2::Float64: Clock bias / drift / drift-rate (s, s/s, s/s²). The broadcast clock is referenced to the B3I signal (ICD §7.6.1).T_GD_B2ap::Float64: Group delay differential of the B2a pilot (s).ISC_B1Cd::Float64: Group delay differential between the B1C data and pilot components (s).T_GD_B1Cp::Float64: Group delay differential of the B1C pilot (s).
Subframe 3 page header (Figures 6-8 .. 6-11, §7.14-7.17)
Present on every defined page type, refreshed whenever any page decodes:
hs::Int64: Satellite health status (Table 7-22: 0 healthy, 1 unhealthy or in test, 2-3 reserved).dif::Bool,sif::Bool,aif::Bool: Data / signal / accuracy integrity flags for B1C (Table 7-23;trueflags a problem).sismai::Int64: Signal-in-space monitoring accuracy index (4 bits).sisai_oe::Int64: Orbit along-track/cross-track accuracy index (5 bits, pages 1 and 3).t_op::Int64: Time of week for data prediction (raw 11-bit count; its scale is deferred to a future ICD update, §7.16), andsisai_ocb::Int64,sisai_oc1::Int64,sisai_oc2::Int64: orbit radius / clock accuracy indices (pages 1, 2, and 4).
Subframe 3, page type 1 — ionosphere + BDT-UTC (Figures 6-16, 6-17)
α_1 .. α_9::Float64: BDGIM ionospheric coefficients (TECu; Table 7-10 — the broadcastα_5carries scale factor −2⁻³, applied on decode).A_0UTC,A_1UTC,A_2UTC::Float64: BDT-UTC polynomial (s, s/s, s/s²).Δt_LS,Δt_LSF::Int64: current and future leap-second counts (s).t_ot::Int64: UTC reference time of week (s);WN_ot::Int64: reference week.WN_LSF::Int64,DN::Int64: leap-second reference week/day (day 0..6).
Subframe 3, page type 3 — EOP + BGTO (Figures 6-19, 6-20)
t_EOP::Int64: EOP reference time of week (s).PM_X,PM_X_dot,PM_Y,PM_Y_dot::Float64: polar motion (arc-seconds, arc-seconds/day).ΔUT1::Float64,ΔUT1_dot::Float64: UT1-UTC difference (s) and rate (s/day).bgtos::Dictionary{Int,BeiDouB1CBGTO}: BDT-GNSS time offsets keyed by GNSS ID.
Subframe 3, page types 2/4 — keyed almanac dictionaries
reduced_almanacs::Dictionary{Int,BeiDouReducedAlmanac}(page type 2).midi_almanacs::Dictionary{Int,BeiDouMidiAlmanac}(page type 4).
Counters
num_sf3_pages_received::Int: Count of CRC-valid subframe-3 pages received.
Reference
BDS-SIS-ICD-B1C-1.0, Figures 6-5 .. 6-21 and Tables 7-2 .. 7-23.
GNSSDecoder.BeiDouB1CBGTO — Type
BeiDouB1CBGTOOne BDT-GNSS time offset (BGTO) parameter set from B-CNAV1 subframe 3, page type 3 (BDS-SIS-ICD-B1C-1.0 Figure 6-20, Table 7-21).
Δt = t_BD - t_GNSS = A_0BGTO + A_1BGTO·Δτ + A_2BGTO·Δτ² with Δτ = t_BD - t_0BGTO + 604800(WN - WN_0BGTO) (ICD Eq. 7-30). Different frames may broadcast offsets for different systems, so sets are keyed by gnss_id in BeiDouB1CData.
Fields
gnss_id::Int: GNSS type the offset refers to (1 GPS, 2 Galileo, 3 GLONASS; 0 marks the parameters as unavailable and is never stored).WN_0BGTO::Int: Reference week number.t_0BGTO::Int: Reference time of week (seconds).A_0BGTO::Float64,A_1BGTO::Float64,A_2BGTO::Float64: Bias / drift / drift-rate coefficients (s, s/s, s/s²).
Reference
BDS-SIS-ICD-B1C-1.0, Figure 6-20, Table 7-21, §7.13.2.
BeiDou B2a
GNSSDecoder.BeiDouB2aConstants — Type
struct BeiDouB2aConstants <: GNSSDecoder.AbstractGNSSConstantsConstants for the BeiDou B2a (B-CNAV2) decoder (BDS-SIS-ICD-B2a-1.0).
Fields
syncro_sequence_length::Int64: Frame length drained after each decoded frame (600 symbols)
preamble_length::Int64: Preamble length (24 symbols,0xE24DE8, ICD §6.2.1)
preamble::UInt64: Preamble bit pattern (MSB-first packing of111000100100110111101000)
PI::Float64: Mathematical constant π (ICD Table 7-9)
Ω_dot_e::Float64: BDCS Earth rotation rate (rad/s, ICD Table 7-9 — differs from WGS-84)
c::Float64: Speed of light (m/s, ICD §7.5.2)
μ::Float64: BDCS geocentric gravitational constant (m³/s², ICD Table 7-9)
F::Float64: Relativistic correction constant F = −2√μ/c² (s/√m, ICD §7.5.2; same value as Galileo's GTRF constant because μ agrees)
GNSSDecoder.BeiDouB2aData — Type
struct BeiDouB2aData <: GNSSDecoder.AbstractBeiDouDataDecoded BeiDou B2a B-CNAV2 navigation data (BDS-SIS-ICD-B2a-1.0 §6.2.3, §7).
Every field is nothing until its carrying message type has been decoded. Angles are stored in radians (ICD semicircle values scaled by π = GNSS_PI), times in seconds, week numbers in weeks of BDT (epoch 2006-01-01T00:00:00 UTC, §7.3).
Ephemeris pairing bookkeeping: ephemeris I lives in message type 10 (with the set's IODE) and ephemeris II in message type 11, which carries no IOD of its own — the ICD instead requires MT10 and MT11 to be broadcast continuously together (§6.2.3). SOW_mt10 / SOW_mt11 record the SOW of the frames that delivered each half so is_ephemeris_decoded can require them to be adjacent frames (|ΔSOW| = 3 s), which is what "broadcast continuously together" makes observable on the air interface.
Fields
last_message_id::Int64: Message type of the most recently decoded frame (0 = none yet)
SOW::Union{Nothing, Int64}: Seconds of week of the most recent frame (s; epoch = rising edge of that frame's first preamble chip, §7.3)
WN::Union{Nothing, Int64}: BDT week number (MT10, §7.3)
HS::Union{Nothing, Int64}: Satellite health status HS (2 bits: 0 healthy, 1 unhealthy or in test, 2-3 reserved; MT11/30-34/40, §7.14)
DIF_B2a::Union{Nothing, Bool}: B2a data integrity flag (0 = message error within predictive accuracy, §7.15)
SIF_B2a::Union{Nothing, Bool}: B2a signal integrity flag (0 = signal normal, §7.15)
AIF_B2a::Union{Nothing, Bool}: B2a accuracy integrity flag (0 = SISMAI value valid, §7.15)
SISMAI::Union{Nothing, Int64}: Signal in space monitoring accuracy index (4 bits; definition deferred to a future ICD update, §7.17)
DIF_B1C::Union{Nothing, Bool}: B1C data integrity flag (also broadcast on B-CNAV2, §7.15)
SIF_B1C::Union{Nothing, Bool}: B1C signal integrity flag (§7.15)
AIF_B1C::Union{Nothing, Bool}: B1C accuracy integrity flag (§7.15)
IODE::Union{Nothing, Int64}: Issue of data, ephemeris (8 bits, MT10, §7.4.1)
t_0e::Union{Nothing, Int64}: Ephemeris reference time (s, ×300)
sat_type::Union{Nothing, Int64}: Satellite orbit type (2 bits: 1 = GEO, 2 = IGSO, 3 = MEO, 0 reserved; Table 7-8)
ΔA::Union{Nothing, Float64}: Semi-major axis difference at reference time (m; vs A_ref = 27906100 m MEO / 42162200 m IGSO-GEO)
A_dot::Union{Nothing, Float64}: Change rate of semi-major axis (m/s)
Δn_0::Union{Nothing, Float64}: Mean motion difference at reference time (rad/s)
Δn_0_dot::Union{Nothing, Float64}: Rate of mean motion difference (rad/s²)
M_0::Union{Nothing, Float64}: Mean anomaly at reference time (rad)
e::Union{Nothing, Float64}: Eccentricity (dimensionless)
ω::Union{Nothing, Float64}: Argument of perigee (rad)
SOW_mt10::Union{Nothing, Int64}: SOW of the frame that delivered ephemeris I (pairing bookkeeping, see type docstring)
Ω_0::Union{Nothing, Float64}: Longitude of ascending node at weekly epoch (rad, MT11)
i_0::Union{Nothing, Float64}: Inclination angle at reference time (rad)
Ω_dot::Union{Nothing, Float64}: Rate of right ascension (rad/s)
i_dot::Union{Nothing, Float64}: Rate of inclination angle (rad/s)
C_is::Union{Nothing, Float64}: Amplitude of sine harmonic correction to inclination (rad)
C_ic::Union{Nothing, Float64}: Amplitude of cosine harmonic correction to inclination (rad)
C_rs::Union{Nothing, Float64}: Amplitude of sine harmonic correction to orbit radius (m)
C_rc::Union{Nothing, Float64}: Amplitude of cosine harmonic correction to orbit radius (m)
C_us::Union{Nothing, Float64}: Amplitude of sine harmonic correction to argument of latitude (rad)
C_uc::Union{Nothing, Float64}: Amplitude of cosine harmonic correction to argument of latitude (rad)
SOW_mt11::Union{Nothing, Int64}: SOW of the frame that delivered ephemeris II (pairing bookkeeping, see type docstring)
IODC::Union{Nothing, Int64}: Issue of data, clock (10 bits; a matched pair has IODE == IODC & 0xFF, §7.4.3)
t_0c::Union{Nothing, Int64}: Clock correction reference time (s, ×300)
a_0::Union{Nothing, Float64}: SV clock bias (s)
a_1::Union{Nothing, Float64}: SV clock drift (s/s)
a_2::Union{Nothing, Float64}: SV clock drift rate (s/s²)
T_GD_B2ap::Union{Nothing, Float64}: Group delay differential of the B2a pilot component vs the B3I-referenced clock (s)
ISC_B2ad::Union{Nothing, Float64}: Group delay differential between the B2a data and pilot components (s)
T_GD_B1Cp::Union{Nothing, Float64}: Group delay differential of the B1C pilot component (s)
α_1::Union{Nothing, Float64}: BDGIM parameter α₁ (TECu)
α_2::Union{Nothing, Float64}: BDGIM parameter α₂ (TECu)
α_3::Union{Nothing, Float64}: BDGIM parameter α₃ (TECu)
α_4::Union{Nothing, Float64}: BDGIM parameter α₄ (TECu)
α_5::Union{Nothing, Float64}: BDGIM parameter α₅ (TECu; broadcast with scale −2⁻³, Table 7-10)
α_6::Union{Nothing, Float64}: BDGIM parameter α₆ (TECu)
α_7::Union{Nothing, Float64}: BDGIM parameter α₇ (TECu)
α_8::Union{Nothing, Float64}: BDGIM parameter α₈ (TECu)
α_9::Union{Nothing, Float64}: BDGIM parameter α₉ (TECu)
t_EOP::Union{Nothing, Int64}: EOP data reference time (s, ×2⁴)
PM_X::Union{Nothing, Float64}: X-axis polar motion at reference time (arc-seconds)
PM_X_dot::Union{Nothing, Float64}: X-axis polar motion drift (arc-seconds/day)
PM_Y::Union{Nothing, Float64}: Y-axis polar motion at reference time (arc-seconds)
PM_Y_dot::Union{Nothing, Float64}: Y-axis polar motion drift (arc-seconds/day)
ΔUT1::Union{Nothing, Float64}: UT1−UTC difference at reference time (s)
ΔUT1_dot::Union{Nothing, Float64}: Rate of UT1−UTC difference (s/day)
A0_UTC::Union{Nothing, Float64}: Bias coefficient of BDT relative to UTC (s)
A1_UTC::Union{Nothing, Float64}: Drift coefficient of BDT relative to UTC (s/s)
A2_UTC::Union{Nothing, Float64}: Drift rate coefficient of BDT relative to UTC (s/s²)
Δt_LS::Union{Nothing, Int64}: Current or past leap second count (s)
t_ot::Union{Nothing, Int64}: Reference time of week for the UTC parameters (s, ×2⁴)
WN_ot::Union{Nothing, Int64}: Reference week number for the UTC parameters
WN_LSF::Union{Nothing, Int64}: Leap second reference week number
DN::Union{Nothing, Int64}: Leap second reference day number (0-6)
Δt_LSF::Union{Nothing, Int64}: Current or future leap second count (s)
GNSS_ID::Union{Nothing, Int64}: GNSS type the BGTO parameters refer to (0 = unavailable, 1 = GPS, 2 = Galileo, 3 = GLONASS)
WN_0BGTO::Union{Nothing, Int64}: BGTO reference week number
t_0BGTO::Union{Nothing, Int64}: BGTO reference time of week (s, ×2⁴)
A0_BGTO::Union{Nothing, Float64}: Bias coefficient of BDT relative to the identified GNSS time (s)
A1_BGTO::Union{Nothing, Float64}: Drift coefficient of BDT relative to the identified GNSS time (s/s)
A2_BGTO::Union{Nothing, Float64}: Drift rate coefficient of BDT relative to the identified GNSS time (s/s²)
t_op::Union{Nothing, Int64}: Time of week for data prediction (11-bit raw value; definition deferred, §7.16)
SISAI_ocb::Union{Nothing, Int64}: Satellite orbit radius & fixed clock bias accuracy index (raw, §7.16)
SISAI_oc1::Union{Nothing, Int64}: Satellite clock bias accuracy index (raw, §7.16)
SISAI_oc2::Union{Nothing, Int64}: Satellite clock drift accuracy index (raw, §7.16)
SISAI_oe::Union{Nothing, Int64}: Satellite orbit along-track/cross-track accuracy index (raw, MT40, §7.16)
reduced_almanacs::Union{Nothing, Dictionaries.Dictionary{Int64, BeiDouReducedAlmanac}}: Reduced almanacs keyed by PRN (MT31: three per message; MT33: one per message)
midi_almanacs::Union{Nothing, Dictionaries.Dictionary{Int64, BeiDouMidiAlmanac}}: Midi almanacs keyed by PRN (MT40: one per message)
BeiDou B2b
GNSSDecoder.BeiDouB2bConstants — Type
struct BeiDouB2bConstants <: GNSSDecoder.AbstractGNSSConstantsConstants for the BeiDou B2b (B-CNAV3) decoder — BDS-SIS-ICD-B2b-1.0.
Fields
syncro_sequence_length::Int64: Frame length drained after each decoded frame (1000 symbols)
preamble::UInt16: Preamble 0xEB90 (ICD §6.2.1), MSB first
preamble_length::Int64: Trailing next-frame preamble segment retained for sync (16 symbols)
PI::Float64: Mathematical constant π (BDS-SIS-ICD-B2b-1.0 Table 7-13)
Ω_dot_e::Float64: BDCS Earth rotation rate (rad/s) — differs from the WGS-84 value
c::Float64: Speed of light (m/s)
μ::Float64: BDCS Earth gravitational parameter (m³/s²)
F::Float64: Relativistic correction constant F = -2√μ/c² (s/√m, ICD §7.4.2)
GNSSDecoder.BeiDouB2bData — Type
BeiDouB2bData <: AbstractBeiDouDataDecoded BeiDou B-CNAV3 navigation data (BDS-SIS-ICD-B2b-1.0 §6.2.3 / §7).
Every field is nothing until first decoded from a CRC-validated frame. Message type 10 carries a complete ephemeris in one frame, message type 30 a complete clock set; B-CNAV3 broadcasts no issue-of-data stamps, so no cross-message consistency vote is needed (or possible) before promotion — each CRC-gated message is atomic.
Header (every message type)
last_message_type::Int: MesType of the most recently decoded frame (Table 7-1; 0 until the first decode).SOW::Int64: Seconds of week of the current frame's leading edge (s). Broadcast as a 20-bit count with LSB 1 s (Table 7-2).
Message type 10 — ephemeris (Figures 6-3, 6-6, 6-7) and integrity flags
sat_type::Int64: Satellite orbit type (binary 01 = GEO, 10 = IGSO, 11 = MEO; Table 7-6).t_0e::Int64: Ephemeris reference time (s, LSB 300).ΔA::Float64: Semi-major axis difference at reference time (m) relative toA_ref = 27 906 100 m(MEO) /42 162 200 m(IGSO/GEO).A_dot::Float64: Change rate of semi-major axis (m/s).Δn_0::Float64: Mean motion difference at reference time (rad/s).Δn_0_dot::Float64: Rate of mean motion difference (rad/s²).M_0::Float64: Mean anomaly at reference time (rad).e::Float64: Eccentricity.ω::Float64: Argument of perigee (rad).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).i_0::Float64: Inclination at reference time (rad).Ω_dot::Float64: Rate of right ascension (rad/s) — broadcast in full, not as a difference.i_dot::Float64: Rate of inclination (rad/s).C_is,C_ic::Float64: Sine/cosine harmonic correction to inclination (rad).C_rs,C_rc::Float64: Sine/cosine harmonic correction to orbit radius (m).C_us,C_uc::Float64: Sine/cosine harmonic correction to argument of latitude (rad).dif,sif,aif::Bool: Data / signal / accuracy integrity flags for the B2b_I signal (false= OK, Table 7-21).sismai::Int64: Signal in space monitoring accuracy index (4 bits; semantics deferred to a future ICD update, §7.16).
Message type 30 — clock, group delay, ionosphere, UTC, EOP, accuracy, health
WN::Int64: BDT week number at the current frame's epoch (Table 7-2).t_0c::Int64: Clock correction reference time (s, LSB 300).a_f0::Float64: Clock bias (s).a_f1::Float64: drift (s/s).a_f2::Float64: drift rate (s/s²). (Table 7-3; the ICD names them a0/a1/a2.)T_GD_B2bI::Float64: Group delay differential of the B2b_I signal relative to B3I (s, Table 7-4).α_1 … α_9::Float64: BDGIM ionospheric model parameters (TECu, Table 7-8; α_5 is broadcast with the negative scale factor -2⁻³ already applied).A0_UTC,A1_UTC,A2_UTC::Float64: BDT-UTC polynomial (s, s/s, s/s²; Table 7-18).Δt_LS::Int64: Current or past leap-second count (s).Δt_LSF::Int64: current or future leap-second count (s).t_ot::Int64: UTC reference time of week (s, LSB 2⁴).WN_ot::Int64: UTC reference week.WN_LSF::Int64: Leap-second reference week.DN::Int64: leap-second reference day (0-6).t_EOP::Int64: EOP reference time (s, LSB 2⁴; Table 7-16).PM_X,PM_Y::Float64: Polar motion (arc-seconds).PM_X_dot,PM_Y_dot::Float64: drift (arc-seconds/day).ΔUT1::Float64: UT1-UTC difference (s).ΔUT1_dot::Float64: its rate (s/day).sisai_t_op,sisai_ocb,sisai_oc1,sisai_oc2,sisai_oe::Int64: Signal-in-space accuracy index fields, raw broadcast values (11/5/3/3/5 bits; semantics deferred to a future ICD update, §7.15).hs::Int64: Satellite health status (0 = healthy, 1 = unhealthy or in test, 2-3 reserved; Table 7-20).
Message type 40 — BGTO and almanacs (Figure 6-5)
GNSS_ID::Int64: BGTO GNSS identification (0 = not available, 1 = GPS, 2 = Galileo, 3 = GLONASS; §7.12).WN_0BGTO::Int64,t_0BGTO::Int64: BGTO reference week / time of week (s, LSB 2⁴).A0_BGTO,A1_BGTO,A2_BGTO::Float64: BDT-GNSS time offset polynomial (s, s/s, s/s²; Table 7-19).midi_almanacs::Dictionary{Int,BeiDouMidiAlmanac}: Midi almanacs keyed byPRN_a(§7.8).reduced_almanacs::Dictionary{Int,BeiDouReducedAlmanac}: Reduced almanacs keyed byPRN_a(§7.9).WN_a::Int64,t_0a::Int64: Almanac reference week / time (s, LSB 2¹²) for the reduced almanacs (Table 7-15).
Reference
BDS-SIS-ICD-B2b-1.0, Figures 6-3 through 6-15 and Tables 7-1 through 7-21.
BeiDou shared almanac records
The BDS-3 midi and reduced almanac blocks are bit-identical across B-CNAV1 (B1C), B-CNAV2 (B2a), and B-CNAV3 (B2b), so all three decoders produce the same record types.
GNSSDecoder.BeiDouMidiAlmanac — Type
BeiDouMidiAlmanacMidi almanac for one BeiDou satellite.
The BDS-3 midi almanac is one 156-bit block whose layout, scale factors, and reference values are identical across the three B-CNAV messages, so the same record is produced by the B1C decoder (B-CNAV1 subframe 3 page type 4, BDS-SIS-ICD-B1C-1.0 Figure 6-21 / Table 7-13), the B2a decoder (B-CNAV2 message type 40, BDS-SIS-ICD-B2a-1.0 Figure 6-20 / Table 7-13), and the B2b decoder (B-CNAV3 message type 40, BDS-SIS-ICD-B2b-1.0 Figure 6-15 / Table 7-11) — mirroring how GalileoAlmanac is shared by the I/NAV and F/NAV decoders. Each block is complete in itself and keyed by PRN_a in the per-signal data containers.
Reference value to apply (ICD notes to the midi-almanac tables): inclination is i = i_ref + δi with i_ref = 0.30π rad (54°) for MEO/IGSO satellites and i_ref = 0.0 for GEO satellites, selected by sat_type. Semi-circle fields are converted to radians on decode.
Fields
PRN_a::Int: Almanac satellite PRN (1-63; a zero PRN marks an empty block and is never stored).sat_type::Int: Satellite orbit type (2 bits: 1 = GEO, 2 = IGSO, 3 = MEO, 0 reserved).WN_a::Int: Almanac reference week number (BDT week).t_oa::Int: Almanac reference time of week (seconds, LSB 2¹²).e::Float64: Eccentricity (dimensionless).δi::Float64: Inclination delta from thesat_typereference (rad).sqrt_A::Float64: Square root of the semi-major axis (√m).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).Ω_dot::Float64: Rate of right ascension (rad/s).ω::Float64: Argument of perigee (rad).M_0::Float64: Mean anomaly at reference time (rad).a_f0::Float64,a_f1::Float64: Satellite clock bias / drift (s, s/s).health::Int: Raw 8-bit satellite health word (BDS-SIS-ICD-B2b-1.0 Table 7-12, the fullest definition: bit 8 (MSB) = satellite clock, bit 7 = B1C signal, bit 6 = B2a signal, bit 5 = B2b_I signal, bits 4-1 reserved; 0 = healthy. The earlier B1C/B2a ICDs' Table 7-14 defines the same word without the B2b bit).
GNSSDecoder.BeiDouReducedAlmanac — Type
BeiDouReducedAlmanacReduced almanac for one BeiDou satellite.
The BDS-3 reduced almanac is one 38-bit block whose layout, scale factors, and reference values are identical across the three B-CNAV messages, so the same record is produced by the B1C decoder (B-CNAV1 subframe 3 page type 2, four blocks per page, BDS-SIS-ICD-B1C-1.0 Figure 6-18 / Table 7-16), the B2a decoder (B-CNAV2 message types 31 and 33, BDS-SIS-ICD-B2a-1.0 Figure 6-17 / Table 7-16), and the B2b decoder (B-CNAV3 message type 40, five blocks per message, BDS-SIS-ICD-B2b-1.0 Figure 6-12 / Table 7-14). The 38-bit block itself carries no epoch; the almanac reference week/time broadcast alongside it in the carrying page/message is copied into every record, so each record is complete in itself and keyed by PRN_a in the per-signal data containers.
Reference values to apply (ICD notes to the reduced-almanac tables): A = A_ref + δA with A_ref = 27 906 100 m (MEO) or 42 162 200 m (IGSO/GEO) selected by sat_type; Φ₀ = M₀ + ω relative to e = 0 and δi = 0 with i = 55° (MEO/IGSO) or i = 0° (GEO). The user algorithm is the midi almanac's with the missing parameters set to zero.
Fields
PRN_a::Int: Almanac satellite PRN (1-63; a zero PRN marks an empty block and is never stored).sat_type::Int: Satellite orbit type (2 bits: 1 = GEO, 2 = IGSO, 3 = MEO, 0 reserved).WN_a::Int: Almanac reference week number (from the carrying page/message).t_oa::Int: Almanac reference time of week (seconds, from the carrying page/message).δA::Float64: Semi-major-axis correction to thesat_typereference (m).Ω_0::Float64: Longitude of ascending node at weekly epoch (rad).Φ_0::Float64: Argument of latitude at reference time,M₀ + ω(rad).health::Int: Raw 8-bit satellite health word (same layout asBeiDouMidiAlmanac's).