File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments