use of org.orekit.estimation.measurements.modifiers.RangeIonosphericDelayModifier in project Orekit by CS-SI.
the class IonoModifierTest method testRangeIonoModifier.
@Test
public void testRangeIonoModifier() throws OrekitException {
Context context = EstimationTestUtils.eccentricContext("regular-data:potential:tides");
final NumericalPropagatorBuilder propagatorBuilder = context.createBuilder(OrbitType.KEPLERIAN, PositionAngle.TRUE, true, 1.0e-6, 60.0, 0.001);
// create perfect range measurements
for (final GroundStation station : context.stations) {
station.getEastOffsetDriver().setSelected(true);
station.getNorthOffsetDriver().setSelected(true);
station.getZenithOffsetDriver().setSelected(true);
}
final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new RangeMeasurementCreator(context), 1.0, 3.0, 300.0);
propagator.setSlaveMode();
final RangeIonosphericDelayModifier modifier = new RangeIonosphericDelayModifier(model);
for (final ObservedMeasurement<?> measurement : measurements) {
final AbsoluteDate date = measurement.getDate();
final SpacecraftState refstate = propagator.propagate(date);
Range range = (Range) measurement;
EstimatedMeasurement<Range> evalNoMod = range.estimate(12, 17, new SpacecraftState[] { refstate });
Assert.assertEquals(12, evalNoMod.getIteration());
Assert.assertEquals(17, evalNoMod.getCount());
// add modifier
range.addModifier(modifier);
boolean found = false;
for (final EstimationModifier<Range> existing : range.getModifiers()) {
found = found || existing == modifier;
}
Assert.assertTrue(found);
//
EstimatedMeasurement<Range> eval = range.estimate(0, 0, new SpacecraftState[] { refstate });
Assert.assertEquals(evalNoMod.getStatus(), eval.getStatus());
eval.setStatus(EstimatedMeasurement.Status.REJECTED);
Assert.assertEquals(EstimatedMeasurement.Status.REJECTED, eval.getStatus());
eval.setStatus(evalNoMod.getStatus());
try {
eval.getParameterDerivatives(new ParameterDriver("extra", 0, 1, -1, +1));
Assert.fail("an exception should have been thrown");
} catch (OrekitIllegalArgumentException oiae) {
Assert.assertEquals(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, oiae.getSpecifier());
}
final double diffMeters = eval.getEstimatedValue()[0] - evalNoMod.getEstimatedValue()[0];
// TODO: check threshold
Assert.assertEquals(0.0, diffMeters, 30.0);
}
}
Aggregations