Skip to content
Snippets Groups Projects
Commit d5f68c4b authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Fixed parsing of compact RINEX files with missing types in header.

The error seems to occur only in files produced by some Septentrio
receivers.

Fixes #603
parent 341db008
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,10 @@
</properties>
<body>
<release version="10.1" date="TBD" description="TBD">
<action dev="luc" type="fix" issue="603">
Fixed parsing of compact RINEX files with missing types in header
produced by some Septentrio receivers.
</action>
<action dev="evan" type="fix" issue="589">
Improve performance of AggregateBoundedPropagator by factor of 2.
</action>
......
......@@ -877,7 +877,9 @@ public class RinexLoader {
satSystemPhaseShift = SatelliteSystem.parseSatelliteSystem(parseString(0, 1));
final String to = parseString(2, 3);
phaseShiftTypeObs = to.isEmpty() ? null : ObservationType.valueOf(to);
phaseShiftTypeObs = to.isEmpty() ?
null :
ObservationType.valueOf(to.length() < 3 ? "L" + to : to);
nbSatPhaseShift = parseInt(16, 2);
corrPhaseShift = parseDouble(6, 8);
......
......@@ -510,7 +510,7 @@ public class HatanakaCompressFilterTest {
@Test
public void testManyObservations() throws IOException, NoSuchAlgorithmException {
final String name = "rinex/THTG00PYF_R_20160440000_01D_30S_MO.crx.gz";
final String name = "rinex/THTG00PYF_R_20160440000_60S_30S_MO.crx.gz";
final NamedData raw = new NamedData(name.substring(name.indexOf('/') + 1),
() -> Utils.class.getClassLoader().getResourceAsStream(name));
NamedData filtered = new HatanakaCompressFilter().filter(new GzipFilter().filter(raw));
......@@ -534,6 +534,33 @@ public class HatanakaCompressFilterTest {
}
@Test
public void testSeptentrioMissingType() throws IOException, NoSuchAlgorithmException {
final String name = "rinex/TLSG00FRA_R_20160440000_30S_30S_MO.crx.gz";
final NamedData raw = new NamedData(name.substring(name.indexOf('/') + 1),
() -> Utils.class.getClassLoader().getResourceAsStream(name));
NamedData filtered = new HatanakaCompressFilter().filter(new GzipFilter().filter(raw));
MessageDigest md = MessageDigest.getInstance("SHA-256");
RinexLoader loader = new RinexLoader(new DigestInputStream(filtered.getStreamOpener().openStream(), md),
filtered.getName());
AbsoluteDate t0 = new AbsoluteDate(2016, 2, 13, 0, 0, 0.0, TimeScalesFactory.getGPS());
List<ObservationDataSet> ods = loader.getObservationDataSets();
Assert.assertEquals(69, ods.size());
Assert.assertEquals("TLSG", ods.get(37).getHeader().getMarkerName());
Assert.assertEquals(SatelliteSystem.SBAS, ods.get(37).getSatelliteSystem());
Assert.assertEquals(123, ods.get(37).getPrnNumber());
Assert.assertEquals(30.0, ods.get(37).getDate().durationFrom(t0), 1.0e-15);
Assert.assertEquals(ObservationType.D1C, ods.get(37).getObservationData().get(2).getObservationType());
Assert.assertEquals(2.648, ods.get(37).getObservationData().get(2).getValue(), 1.0e-15);
// the reference digest was computed externally using CRX2RNX and sha256sum on a Linux computer
checkDigest("79b524e36869055b41238ee5919b13f0ca2923b95f8516fe0e09a7ac968a62d6", md);
}
private void checkDigest(final String expected, final MessageDigest md) {
StringBuilder builder = new StringBuilder();
for (final byte b : md.digest()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment