Skip to content

Commit c751987

Browse files
committed
docs(lox-earth): add comment
1 parent 9d2c6df commit c751987

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/lox-earth/src/iers.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,23 @@ impl EopParser {
120120
let mut dx: Vec<f64> = Vec::with_capacity(n);
121121
let mut dy: Vec<f64> = Vec::with_capacity(n);
122122

123+
// The EOP from the IERS are split into two different files based on the two IAU conventions for some reason.
124+
// Both files have the same header and identical data except that the columns for the IAU1980 parameters are
125+
// only populated in `finals.all.csv` and the columns for the IAU2000 parameters are only populated in
126+
// `finals2000A.all.csv`.
127+
// We do not want to force the user to provide both files if they do not need them. At the same time, we want
128+
// to parse both files in one pass if they are present to avoid looping over tens of thousands of lines
129+
// multiple time.
130+
// I have not been able to fulfil both requirements and make the compiler happy without pretending that there
131+
// are always two files. In case the user provided two files, we parse both files and merge the records.
132+
// If we have only one file, we still parse it twice and record merging is a no-op.
123133
let mut rdr1 = ReaderBuilder::new()
124134
.delimiter(b';')
125135
.from_path(self.paths.0.as_ref().unwrap())?;
126136
let mut rdr2 = ReaderBuilder::new()
127137
.delimiter(b';')
128138
.from_path(self.paths.1.as_ref().or(self.paths.0.as_ref()).unwrap())?;
139+
129140
let mut raw1 = ByteRecord::new();
130141
let mut raw2 = ByteRecord::new();
131142
let headers = rdr1.byte_headers()?.clone();

0 commit comments

Comments
 (0)