Commit 0584cca7 authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Merge branch 'issue-845' into release-11.0

parents 7db3658a caf4c3fe
......@@ -333,7 +333,10 @@ public class RinexClockParser {
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_PROGRAM);
return Stream.of(HEADER_PROGRAM, HEADER_COMMENT, HEADER_SYSTEM_OBS, HEADER_SYSTEM_OBS_CONTINUATION, HEADER_TIME_SYSTEM, HEADER_LEAP_SECONDS,
HEADER_LEAP_SECONDS_GNSS, HEADER_DCBS, HEADER_PCVS, HEADER_TYPES_OF_DATA, HEADER_STATIONS_NAME, HEADER_STATION_CLOCK_REF,
HEADER_ANALYSIS_CENTER, HEADER_NUMBER_OF_CLOCK_REF, HEADER_ANALYSIS_CLOCK_REF, HEADER_NUMBER_OF_SOLN_STATIONS,
HEADER_SOLN_STATIONS, HEADER_NUMBER_OF_SOLN_SATS, HEADER_PRN_LIST, HEADER_END);
}
},
......@@ -371,12 +374,6 @@ public class RinexClockParser {
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_COMMENT, HEADER_SYSTEM_OBS, HEADER_DCBS, HEADER_PCVS,
HEADER_TIME_SYSTEM, HEADER_LEAP_SECONDS, HEADER_LEAP_SECONDS_GNSS);
}
},
/** Parser for comments. */
......@@ -393,11 +390,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_COMMENT, HEADER_SYSTEM_OBS, HEADER_TYPES_OF_DATA, HEADER_TIME_SYSTEM, HEADER_LEAP_SECONDS, HEADER_LEAP_SECONDS_GNSS, HEADER_END);
}
},
/** Parser for satellite system and related observation types. */
......@@ -427,12 +419,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_SYSTEM_OBS, HEADER_COMMENT, HEADER_SYSTEM_OBS_CONTINUATION,
HEADER_TIME_SYSTEM, HEADER_LEAP_SECONDS, HEADER_LEAP_SECONDS_GNSS);
}
},
/** Parser for continuation of satellite system and related observation types. */
......@@ -456,11 +442,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_SYSTEM_OBS, HEADER_TIME_SYSTEM, HEADER_COMMENT, HEADER_LEAP_SECONDS, HEADER_LEAP_SECONDS_GNSS);
}
},
/** Parser for data time system. */
......@@ -481,11 +462,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_LEAP_SECONDS, HEADER_LEAP_SECONDS_GNSS, HEADER_COMMENT, HEADER_DCBS, HEADER_PCVS, HEADER_TYPES_OF_DATA);
}
},
/** Parser for leap seconds. */
......@@ -504,11 +480,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_LEAP_SECONDS_GNSS, HEADER_DCBS, HEADER_PCVS, HEADER_COMMENT, HEADER_TYPES_OF_DATA, HEADER_NUMBER_OF_CLOCK_REF);
}
},
/** Parser for leap seconds GNSS. */
......@@ -527,11 +498,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_DCBS, HEADER_PCVS, HEADER_COMMENT, HEADER_TYPES_OF_DATA, HEADER_NUMBER_OF_CLOCK_REF);
}
},
/** Parser for applied differencial code bias corrections. */
......@@ -561,11 +527,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_DCBS, HEADER_PCVS, HEADER_COMMENT, HEADER_TYPES_OF_DATA, HEADER_NUMBER_OF_CLOCK_REF, HEADER_END);
}
},
/** Parser for applied phase center variation corrections. */
......@@ -595,11 +556,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_DCBS, HEADER_PCVS, HEADER_COMMENT, HEADER_NUMBER_OF_CLOCK_REF, HEADER_TYPES_OF_DATA, HEADER_END);
}
},
/** Parser for the different clock data types that are stored in the file. */
......@@ -623,11 +579,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_STATIONS_NAME, HEADER_COMMENT, HEADER_ANALYSIS_CENTER, HEADER_END);
}
},
/** Parser for the station with reference clock. */
......@@ -650,11 +601,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_STATION_CLOCK_REF, HEADER_COMMENT, HEADER_ANALYSIS_CENTER, HEADER_END);
}
},
/** Parser for the reference clock in case of calibration data. */
......@@ -670,11 +616,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_ANALYSIS_CENTER, HEADER_COMMENT, HEADER_END);
}
},
/** Parser for the analysis center. */
......@@ -698,12 +639,6 @@ public class RinexClockParser {
pi.file.setAnalysisCenterName(analysisCenterName);
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_NUMBER_OF_CLOCK_REF, HEADER_NUMBER_OF_SOLN_STATIONS, HEADER_DCBS, HEADER_PCVS,
HEADER_COMMENT, HEADER_LEAP_SECONDS, HEADER_LEAP_SECONDS_GNSS, HEADER_END);
}
},
/** Parser for the number of reference clocks over a period. */
......@@ -758,11 +693,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_ANALYSIS_CLOCK_REF, HEADER_COMMENT, HEADER_NUMBER_OF_SOLN_STATIONS, HEADER_NUMBER_OF_SOLN_SATS, HEADER_END);
}
},
/** Parser for the reference clock over a period. */
......@@ -797,12 +727,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_NUMBER_OF_CLOCK_REF, HEADER_ANALYSIS_CLOCK_REF, HEADER_NUMBER_OF_SOLN_STATIONS, HEADER_NUMBER_OF_SOLN_SATS,
HEADER_COMMENT, HEADER_END);
}
},
/** Parser for the number of stations embedded in the file and the related frame. */
......@@ -824,11 +748,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_SOLN_STATIONS, HEADER_COMMENT, HEADER_NUMBER_OF_SOLN_SATS, HEADER_END);
}
},
/** Parser for the stations embedded in the file and the related positions. */
......@@ -876,11 +795,6 @@ public class RinexClockParser {
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_SOLN_STATIONS, HEADER_COMMENT, HEADER_NUMBER_OF_SOLN_SATS, HEADER_END);
}
},
/** Parser for the number of satellites embedded in the file. */
......@@ -894,11 +808,6 @@ public class RinexClockParser {
// Do nothing...
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_PRN_LIST, HEADER_COMMENT, HEADER_END);
}
},
/** Parser for the satellites embedded in the file. */
......@@ -923,11 +832,6 @@ public class RinexClockParser {
}
}
/** {@inheritDoc} */
@Override
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_PRN_LIST, HEADER_COMMENT, HEADER_DCBS, HEADER_PCVS, HEADER_END);
}
},
/** Parser for the end of header. */
......@@ -1066,9 +970,19 @@ public class RinexClockParser {
public abstract void parse(String line, ParseInfo pi);
/** Get the allowed parsers for next line.
* <p>
* Because the standard only recommends an order for header keys,
* the default implementation of the method returns all the
* header keys. Specific implementations must overrides the method.
* </p>
* @return allowed parsers for next line
*/
public abstract Stream<LineParser> allowedNext();
public Stream<LineParser> allowedNext() {
return Stream.of(HEADER_PROGRAM, HEADER_COMMENT, HEADER_SYSTEM_OBS, HEADER_SYSTEM_OBS_CONTINUATION, HEADER_TIME_SYSTEM, HEADER_LEAP_SECONDS,
HEADER_LEAP_SECONDS_GNSS, HEADER_DCBS, HEADER_PCVS, HEADER_TYPES_OF_DATA, HEADER_STATIONS_NAME, HEADER_STATION_CLOCK_REF,
HEADER_ANALYSIS_CENTER, HEADER_NUMBER_OF_CLOCK_REF, HEADER_ANALYSIS_CLOCK_REF, HEADER_NUMBER_OF_SOLN_STATIONS,
HEADER_SOLN_STATIONS, HEADER_NUMBER_OF_SOLN_SATS, HEADER_PRN_LIST, HEADER_END);
}
/** Check if parser can handle line.
* @param line line to parse
......
......@@ -850,7 +850,24 @@ public class ClockFileParserTest {
Assert.assertEquals(TimeScalesFactory.getIRNSS(), TimeSystem.IRNSS.getTimeScale(DataContext.getDefault().getTimeScales()));
Assert.assertEquals(TimeScalesFactory.getGPS(), TimeSystem.UNKNOWN.getTimeScale(DataContext.getDefault().getTimeScales()));
}
/** Test parsing file of issue #845 (https://gitlab.orekit.org/orekit/orekit/-/issues/845). */
@Test
public void testIssue845() throws URISyntaxException, IOException {
// Parse file
final String ex = "/gnss/clock/issue845.clk";
final RinexClockParser parser = new RinexClockParser();
final String fileName = Paths.get(getClass().getResource(ex).toURI()).toString();
final RinexClock file = parser.parse(fileName);
Assert.assertEquals(3.0, file.getFormatVersion(), 1.0e-3);
Assert.assertEquals("GeoForschungsZentrum Potsdam", file.getAnalysisCenterName());
Assert.assertEquals("GFZ", file.getAgencyName());
Assert.assertEquals("IGS14", file.getFrameName());
}
/** Check the content of a clock file. */
private void checkClockFileContent(final RinexClock file,
final double version, final SatelliteSystem satelliteSystem, final TimeSystem timeSystem,
......
3.00 C RINEX VERSION / TYPE
EPOS-8 GFZ 20190702 075449 LCL PGM / RUN BY / DATE
2 AS AR # / TYPES OF DATA
GFZ GeoForschungsZentrum Potsdam ANALYSIS CENTER
1 # OF CLK REF
kour 97301M210 ANALYSIS CLK REF
Clocks are re-aligned to broadcast GPS time COMMENT
119 IGS14 # OF SOLN STA / TRF
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment