Skip to content

Commit 667a548

Browse files
authored
Separate IONEX to dedicated lib (#376)
* Seperate IONEX to dedicated lib * Update readme * Update Docs * Mark breaking change --------- Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
1 parent 99ae049 commit 667a548

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+50
-3910
lines changed

Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rinex"
3-
version = "0.20.2"
3+
version = "0.21.0"
44
license = "MPL-2.0"
55
authors = ["Guillaume W. Bres <guillaume.bressaix@gmail.com>"]
66
description = "RINEX file parsing, analysis and production"
@@ -61,9 +61,6 @@ ut1 = [
6161
# METEO RINEX dedicated Iterators & methods.
6262
meteo = []
6363

64-
# IONEX (special RINEX) dedicated Iterators & methods.
65-
ionex = []
66-
6764
# CLOCK (Special RINEX) dedicated Iterators & methods.
6865
clock = []
6966

@@ -101,7 +98,6 @@ full = [
10198
"clock",
10299
"doris",
103100
"flate2",
104-
"ionex",
105101
"meteo",
106102
"nav",
107103
"obs",

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,19 @@ To contribute to either of our project or join our community, you way
2020
## Advantages :rocket:
2121

2222
- Fast
23-
- Open sources: read and access all the code!
23+
- Open sources: read and access all the code
2424
- All modern GNSS constellations, codes and signals
25-
- Surveying with GPS, Galileo, BeiDou and QZSS
25+
- GPS, Galileo, BeiDou and QZSS
2626
- Time scales: GPST, QZSST, BDT, GST, UTC, TAI
2727
- Efficient seamless compression and decompression
28+
- modern rewrite of the Hatanaka compression algorithm
2829
- RINEX V4 full support, including
2930
- new Ionospheric coorections
3031
- new Time offset corrections
3132
- precise Earth Orientation updates
32-
- Navigation supported in the following constellations
33-
- GPS
34-
- Galileo
35-
- BeiDou
36-
- QZSS
37-
- Most RINEX formats supported (see following table)
38-
- High Precision Clock RINEX products (for PPP)
39-
- DORIS (special RINEX)
33+
- Supports Observation, Navigation, Meteo and Clock RINEX,
34+
other RINEX-like formats have their own parser:
35+
- [IONEX](https://github.com/nav-solutions/ionex)
4036
- Many pre-processing algorithms including Filter Designer
4137
- Several file operations: merging, splitting, time binning (batch)
4238

@@ -49,7 +45,7 @@ To contribute to either of our project or join our community, you way
4945

5046
If you need to reference this work, please use the following model:
5147

52-
`RTK-rs Team (2025), RINEX: analysis and processing (MPLv2), https://github.com/nav-solutions`
48+
`Nav-solutions (2025), RINEX: analysis and processing (MPLv2), https://github.com/nav-solutions`
5349

5450
Formats & revisions
5551
===================

src/epoch.rs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ pub(crate) fn format(epoch: Epoch, t: Type, revision: u8) -> String {
8787
format!("{:04} {:02} {:02} {:02} {:02} {:02}", y, m, d, hh, mm, ss)
8888
}
8989
},
90-
Type::IonosphereMaps => format!(
91-
"{:04} {:>2} {:>2} {:>2} {:>2} {:>2}",
92-
y, m, d, hh, mm, ss
93-
),
9490
_ => {
9591
if revision < 3 {
9692
// old RINEX wants 2 digit YY field
@@ -217,52 +213,6 @@ pub(crate) fn parse_utc(s: &str) -> Result<Epoch, ParsingError> {
217213
parse_in_timescale(s, TimeScale::UTC)
218214
}
219215

220-
pub(crate) fn parse_ionex_utc(s: &str) -> Result<Epoch, ParsingError> {
221-
let (mut y, mut m, mut d, mut hh, mut mm, mut ss) = (0_i32, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8);
222-
for (index, field) in s.split_ascii_whitespace().enumerate() {
223-
match index {
224-
0 => {
225-
y = field
226-
.trim()
227-
.parse::<i32>()
228-
.map_err(|_| ParsingError::EpochParsing)?;
229-
},
230-
1 => {
231-
m = field
232-
.trim()
233-
.parse::<u8>()
234-
.map_err(|_| ParsingError::EpochParsing)?;
235-
},
236-
2 => {
237-
d = field
238-
.trim()
239-
.parse::<u8>()
240-
.map_err(|_| ParsingError::EpochParsing)?;
241-
},
242-
3 => {
243-
hh = field
244-
.trim()
245-
.parse::<u8>()
246-
.map_err(|_| ParsingError::EpochParsing)?;
247-
},
248-
4 => {
249-
mm = field
250-
.trim()
251-
.parse::<u8>()
252-
.map_err(|_| ParsingError::EpochParsing)?;
253-
},
254-
5 => {
255-
ss = field
256-
.trim()
257-
.parse::<u8>()
258-
.map_err(|_| ParsingError::EpochParsing)?;
259-
},
260-
_ => {},
261-
}
262-
}
263-
Ok(Epoch::from_gregorian_utc(y, m, d, hh, mm, ss, 0))
264-
}
265-
266216
pub(crate) fn epoch_decompose(epoch: Epoch) -> (i32, u8, u8, u8, u8, u8, u32) {
267217
epoch.to_gregorian(epoch.time_scale)
268218
}
@@ -573,19 +523,6 @@ mod test {
573523
assert_eq!(format(e, Type::MeteoData, 2), "22 1 4 0 0 0");
574524
}
575525

576-
#[test]
577-
fn ionex_parsing() {
578-
for (desc, expected) in [(
579-
" 2022 1 2 0 0 0 ",
580-
Epoch::from_str("2022-01-02T00:00:00 UTC").unwrap(),
581-
)] {
582-
let epoch = parse_ionex_utc(desc);
583-
assert!(epoch.is_ok(), "failed to parse IONEX/UTC epoch");
584-
let epoch = epoch.unwrap();
585-
assert_eq!(epoch, expected, "invalid IONEX/UTC epoch");
586-
}
587-
}
588-
589526
#[test]
590527
fn epoch_decomposition() {
591528
for (epoch, y, m, d, hh, mm, ss, ns) in [

src/header/formatting.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ impl Header {
214214
},
215215
Type::DORIS => {},
216216
Type::AntennaData => {},
217-
Type::IonosphereMaps => {},
218217
}
219218

220219
Ok(())
@@ -233,8 +232,6 @@ impl Header {
233232
meteo.format(w)
234233
} else if let Some(clock) = &self.clock {
235234
clock.format(w)
236-
} else if let Some(ionex) = &self.ionex {
237-
ionex.format(w)
238235
} else if let Some(antex) = &self.antex {
239236
antex.format(w)
240237
} else if let Some(doris) = &self.doris {

src/header/mod.rs

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
doris::HeaderFields as DorisHeader,
77
hardware::{Antenna, Receiver, SvAntenna},
88
hatanaka::CRINEX,
9-
ionex::HeaderFields as IonexHeader,
109
leap::Leap,
1110
marker::GeodeticMarker,
1211
meteo::HeaderFields as MeteoHeader,
@@ -72,77 +71,104 @@ pub struct PcvCompensation {
7271
pub struct Header {
7372
/// RINEX [Version]
7473
pub version: Version,
74+
7575
/// RINEX [Type]
7676
pub rinex_type: Type,
77+
7778
/// GNSS [Constellation] describing this entire file.
7879
pub constellation: Option<Constellation>,
80+
7981
/// Comments from this section
8082
pub comments: Vec<String>,
83+
8184
/// Possible software name (publishing software)
8285
pub program: Option<String>,
86+
8387
/// Possible software operator
8488
pub run_by: Option<String>,
89+
8590
/// Possible date of publication
8691
pub date: Option<String>,
92+
8793
/// Possible station / agency URL
8894
pub station_url: Option<String>,
95+
8996
/// Name of observer / operator
9097
pub observer: Option<String>,
98+
9199
/// Production Agency
92100
pub agency: Option<String>,
101+
93102
/// Possible [GeodeticMarker]
94103
pub geodetic_marker: Option<GeodeticMarker>,
104+
95105
/// Glonass FDMA channels
96106
pub glo_channels: HashMap<SV, i8>,
107+
97108
/// Possible COSPAR number (launch information)
98109
pub cospar: Option<COSPAR>,
110+
99111
/// Possible [Leap] seconds counter
100112
pub leap: Option<Leap>,
113+
101114
/// Approximate coordinates expressed in ECEF m
102115
pub rx_position: Option<(f64, f64, f64)>,
116+
103117
/// Optionnal wavelength correction factors
104118
pub wavelengths: Option<(u32, u32)>,
119+
105120
/// Possible sampling interval
106121
pub sampling_interval: Option<Duration>,
122+
107123
/// Possible file license
108124
pub license: Option<String>,
125+
109126
/// Possible Digital Object Identifier
110127
pub doi: Option<String>,
128+
111129
/// Possible [Receiver] information
112130
#[cfg_attr(feature = "serde", serde(default))]
113131
pub rcvr: Option<Receiver>,
132+
114133
/// Possible information about Receiver [Antenna]
115134
#[cfg_attr(feature = "serde", serde(default))]
116135
pub rcvr_antenna: Option<Antenna>,
136+
117137
/// Possible information about satellite vehicle antenna.
118138
/// This only exists in ANTEX format.
119139
#[cfg_attr(feature = "serde", serde(default))]
120140
pub sv_antenna: Option<SvAntenna>,
141+
121142
/// Possible Ionospheric Delay correction model, described in
122143
/// header section of old RINEX files (<V4).
123144
pub ionod_corrections: HashMap<Constellation, IonosphereModel>,
145+
124146
/// Possible DCBs compensation information
125147
pub dcb_compensations: Vec<DcbCompensation>,
148+
126149
/// Possible PCVs compensation information
127150
pub pcv_compensations: Vec<PcvCompensation>,
151+
128152
/// Observation RINEX specific fields
129153
#[cfg_attr(feature = "serde", serde(default))]
130154
pub obs: Option<ObservationHeader>,
155+
131156
/// NAV RINEX specific fields
132157
#[cfg_attr(feature = "serde", serde(default))]
133158
pub nav: Option<NavigationHeader>,
159+
134160
/// Meteo RINEX specific fields
135161
#[cfg_attr(feature = "serde", serde(default))]
136162
pub meteo: Option<MeteoHeader>,
163+
137164
/// High Precision Clock RINEX specific fields
138165
#[cfg_attr(feature = "serde", serde(default))]
139166
pub clock: Option<ClockHeader>,
167+
140168
/// ANTEX specific fields
141169
#[cfg_attr(feature = "serde", serde(default))]
142170
pub antex: Option<AntexHeader>,
143-
/// IONEX specific fields
144-
#[cfg_attr(feature = "serde", serde(default))]
145-
pub ionex: Option<IonexHeader>,
171+
146172
/// DORIS RINEX specific fields
147173
#[cfg_attr(feature = "serde", serde(default))]
148174
pub doris: Option<DorisHeader>,
@@ -175,7 +201,6 @@ impl Default for Header {
175201
wavelengths: None,
176202
cospar: None,
177203
doi: None,
178-
ionex: None,
179204
meteo: None,
180205
nav: None,
181206
doris: None,
@@ -222,11 +247,6 @@ impl Header {
222247
.with_observation_fields(ObservationHeader::default().with_crinex(CRINEX::default()))
223248
}
224249

225-
/// Builds a basic [Header] for IONEX
226-
pub fn basic_ionex() -> Self {
227-
Self::default().with_ionex_fields(IonexHeader::default())
228-
}
229-
230250
/// Formats the package version (possibly shortenned, in case of lengthy release)
231251
/// to fit within a formatted COMMENT
232252
pub(crate) fn format_pkg_version(version: &str) -> String {
@@ -353,13 +373,6 @@ impl Header {
353373
s
354374
}
355375

356-
/// Copies and returns [Header] with specific [IonexHeader]
357-
pub fn with_ionex_fields(&self, fields: IonexHeader) -> Self {
358-
let mut s = self.clone();
359-
s.ionex = Some(fields);
360-
s
361-
}
362-
363376
/// Converts approximate coordinates to an [Orbit]
364377
/// at given point in spacetime and using [Frame] model
365378
#[cfg(feature = "nav")]

0 commit comments

Comments
 (0)