Search in sources :

Example 1 with RangeIonosphericDelayModifier

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);
    }
}
Also used : Context(org.orekit.estimation.Context) GroundStation(org.orekit.estimation.measurements.GroundStation) TurnAroundRangeIonosphericDelayModifier(org.orekit.estimation.measurements.modifiers.TurnAroundRangeIonosphericDelayModifier) RangeIonosphericDelayModifier(org.orekit.estimation.measurements.modifiers.RangeIonosphericDelayModifier) TurnAroundRange(org.orekit.estimation.measurements.TurnAroundRange) Range(org.orekit.estimation.measurements.Range) ParameterDriver(org.orekit.utils.ParameterDriver) AbsoluteDate(org.orekit.time.AbsoluteDate) OrekitIllegalArgumentException(org.orekit.errors.OrekitIllegalArgumentException) SpacecraftState(org.orekit.propagation.SpacecraftState) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) RangeMeasurementCreator(org.orekit.estimation.measurements.RangeMeasurementCreator) TurnAroundRangeMeasurementCreator(org.orekit.estimation.measurements.TurnAroundRangeMeasurementCreator) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 OrekitIllegalArgumentException (org.orekit.errors.OrekitIllegalArgumentException)1 Context (org.orekit.estimation.Context)1 GroundStation (org.orekit.estimation.measurements.GroundStation)1 ObservedMeasurement (org.orekit.estimation.measurements.ObservedMeasurement)1 Range (org.orekit.estimation.measurements.Range)1 RangeMeasurementCreator (org.orekit.estimation.measurements.RangeMeasurementCreator)1 TurnAroundRange (org.orekit.estimation.measurements.TurnAroundRange)1 TurnAroundRangeMeasurementCreator (org.orekit.estimation.measurements.TurnAroundRangeMeasurementCreator)1 RangeIonosphericDelayModifier (org.orekit.estimation.measurements.modifiers.RangeIonosphericDelayModifier)1 TurnAroundRangeIonosphericDelayModifier (org.orekit.estimation.measurements.modifiers.TurnAroundRangeIonosphericDelayModifier)1 Propagator (org.orekit.propagation.Propagator)1 SpacecraftState (org.orekit.propagation.SpacecraftState)1 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)1 AbsoluteDate (org.orekit.time.AbsoluteDate)1 ParameterDriver (org.orekit.utils.ParameterDriver)1