Commit f5b11a08 authored by Luc Maisonobe's avatar Luc Maisonobe

Improved test coverage.

parent 440095bf
......@@ -75,7 +75,7 @@ public class RinexLoader {
private static final String CENTER_OF_MASS_XYZ = "CENTER OF MASS: XYZ";
private static final String SIGNAL_STRENGTH_UNIT = "SIGNAL STRENGTH UNIT";
private static final String SYS_NB_OBS_TYPES = "SYS / # / OBS TYPES";
private static final String SYS_DCBS_APPLIED = "SYS / DCBs APPLIED";
private static final String SYS_DCBS_APPLIED = "SYS / DCBS APPLIED";
private static final String SYS_PCVS_APPLIED = "SYS / PCVS APPLIED";
private static final String SYS_SCALE_FACTOR = "SYS / SCALE FACTOR";
private static final String SYS_PHASE_SHIFT = "SYS / PHASE SHIFT";
......@@ -769,11 +769,13 @@ public class RinexLoader {
break;
case SYS_DCBS_APPLIED :
listAppliedDCBs.add(new AppliedDCBs(parseString(line, 2, 17), parseString(line, 20, 40)));
listAppliedDCBs.add(new AppliedDCBs(SatelliteSystem.parseSatelliteSystem(parseString(line, 0, 1)),
parseString(line, 2, 17), parseString(line, 20, 40)));
break;
case SYS_PCVS_APPLIED :
listAppliedPCVS.add(new AppliedPCVS(parseString(line, 2, 17), parseString(line, 20, 40)));
listAppliedPCVS.add(new AppliedPCVS(SatelliteSystem.parseSatelliteSystem(parseString(line, 0, 1)),
parseString(line, 2, 17), parseString(line, 20, 40)));
break;
case SYS_SCALE_FACTOR :
satSystemScaleFactor = null;
......@@ -1143,58 +1145,91 @@ public class RinexLoader {
*/
public class AppliedDCBs {
/** Satellite system. */
private final SatelliteSystem satelliteSystem;
/** Program name used to apply differential code bias corrections. */
private final String progDCBs;
private final String progDCBS;
/** Source of corrections (URL). */
private final String sourceDCBs;
private final String sourceDCBS;
/** Simple constructor.
* @param progDCBsG Program name used to apply DCBs
* @param sourceDCBsG Source of corrections (URL)
* @param satelliteSystem satellite system
* @param progDCBS Program name used to apply DCBs
* @param sourceDCBS Source of corrections (URL)
*/
private AppliedDCBs (final String progDCBsG, final String sourceDCBsG) {
this.progDCBs = progDCBsG;
this.sourceDCBs = sourceDCBsG;
private AppliedDCBs (final SatelliteSystem satelliteSystem,
final String progDCBS, final String sourceDCBS) {
this.satelliteSystem = satelliteSystem;
this.progDCBS = progDCBS;
this.sourceDCBS = sourceDCBS;
}
/** Get the satellite system.
* @return satellite system
*/
public SatelliteSystem getSatelliteSystem() {
return satelliteSystem;
}
/** Get the program name used to apply DCBs.
* @return Program name used to apply DCBs
*/
public String getProgDCBs() {
return progDCBs;
public String getProgDCBS() {
return progDCBS;
}
/** Get the source of corrections.
* @return Source of corrections (URL)
*/
public String getSourceDCBs() {
return sourceDCBs;
public String getSourceDCBS() {
return sourceDCBS;
}
}
/** Corrections of antenna phase center variations (PCVs) applied.
* Contains information on the programs used to correct the observations
* in RINEX files for antenna phase center variations.
*/
public class AppliedPCVS {
/** Satellite system. */
private final SatelliteSystem satelliteSystem;
/** Program name used to antenna center variation corrections. */
private final String progPCVS;
/** Source of corrections (URL). */
private final String sourcePCVS;
/** Simple constructor.
* @param satelliteSystem satellite system
* @param progPCVS Program name used for PCVs
* @param sourcePCVS Source of corrections (URL)
*/
private AppliedPCVS (final String progPCVS, final String sourcePCVS) {
this.progPCVS = progPCVS;
this.sourcePCVS = sourcePCVS;
private AppliedPCVS (final SatelliteSystem satelliteSystem,
final String progPCVS, final String sourcePCVS) {
this.satelliteSystem = satelliteSystem;
this.progPCVS = progPCVS;
this.sourcePCVS = sourcePCVS;
}
/** Get the satellite system.
* @return satellite system
*/
public SatelliteSystem getSatelliteSystem() {
return satelliteSystem;
}
/** Get the program name used to apply PCVs.
* @return Program name used to apply PCVs
*/
public String getProgPCVS() {
return progPCVS;
}
/** Get the source of corrections.
* @return Source of corrections (URL)
*/
......
......@@ -26,6 +26,8 @@ import org.orekit.Utils;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitIllegalArgumentException;
import org.orekit.errors.OrekitMessages;
import org.orekit.gnss.RinexLoader.Parser.AppliedDCBs;
import org.orekit.gnss.RinexLoader.Parser.AppliedPCVS;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScale;
import org.orekit.time.TimeScalesFactory;
......@@ -424,8 +426,39 @@ public class RinexLoaderTest {
Assert.assertEquals(14, ((Integer) oe.getParts()[2]).intValue());
}
}
@Test
public void testDCBSApplied() throws OrekitException {
RinexLoader loader = new RinexLoader("^dcbs\\.00o$");
for (Map.Entry<RinexHeader, List<ObservationDataSet>> entry : loader.getObservations().entrySet()) {
RinexHeader header = entry.getKey();
List<AppliedDCBs> list = header.getListAppliedDCBs();
Assert.assertEquals(2, list.size());
Assert.assertEquals(SatelliteSystem.GPS, list.get(0).getSatelliteSystem());
Assert.assertEquals("some-program-name", list.get(0).getProgDCBS());
Assert.assertEquals("http://example.com/GPS", list.get(0).getSourceDCBS());
Assert.assertEquals(SatelliteSystem.GLONASS, list.get(1).getSatelliteSystem());
Assert.assertEquals("some-program-name", list.get(1).getProgDCBS());
Assert.assertEquals("http://example.com/GLONASS", list.get(1).getSourceDCBS());
}
}
@Test
public void testPCVSApplied() throws OrekitException {
RinexLoader loader = new RinexLoader("^pcvss\\.00o$");
for (Map.Entry<RinexHeader, List<ObservationDataSet>> entry : loader.getObservations().entrySet()) {
RinexHeader header = entry.getKey();
List<AppliedPCVS> list = header.getListAppliedPCVS();
Assert.assertEquals(2, list.size());
Assert.assertEquals(SatelliteSystem.GPS, list.get(0).getSatelliteSystem());
Assert.assertEquals("some-program-name", list.get(0).getProgPCVS());
Assert.assertEquals("http://example.com/GPS", list.get(0).getSourcePCVS());
Assert.assertEquals(SatelliteSystem.GLONASS, list.get(1).getSatelliteSystem());
Assert.assertEquals("some-program-name", list.get(1).getProgPCVS());
Assert.assertEquals("http://example.com/GLONASS", list.get(1).getSourcePCVS());
}
}
private void checkObservation(final ObservationDataSet obser,
final int year, final int month, final int day,
final int hour, final int minute, final double second,
......
This diff is collapsed.
This diff is collapsed.
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