Search in sources :

Example 6 with ObservedMeasurement

use of org.orekit.estimation.measurements.ObservedMeasurement in project Orekit by CS-SI.

the class OnBoardAntennaTurnAroundRangeModifierTest method testPreliminary.

@Test
public void testPreliminary() throws OrekitException {
    // this test does not check OnBoardAntennaTurnAroundRangeModifier at all,
    // it just checks TurnAroundRangeMeasurementCreator behaves as necessary for the other test
    // the *real* test is testEffect below
    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);
    propagatorBuilder.setAttitudeProvider(new LofOffset(propagatorBuilder.getFrame(), LOFType.LVLH));
    // create perfect turn-around range measurements without antenna offset
    final Propagator p1 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> spacecraftCenteredMeasurements = EstimationTestUtils.createMeasurements(p1, new TurnAroundRangeMeasurementCreator(context, Vector3D.ZERO), 1.0, 3.0, 300.0);
    // create perfect turn-around range measurements with antenna offset
    final double xOffset = -2.5;
    final Propagator p2 = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> antennaCenteredMeasurements = EstimationTestUtils.createMeasurements(p2, new TurnAroundRangeMeasurementCreator(context, new Vector3D(xOffset, 0, 0)), 1.0, 3.0, 300.0);
    for (int i = 0; i < spacecraftCenteredMeasurements.size(); ++i) {
        TurnAroundRange sr = (TurnAroundRange) spacecraftCenteredMeasurements.get(i);
        TurnAroundRange ar = (TurnAroundRange) antennaCenteredMeasurements.get(i);
        Assert.assertEquals(0.0, sr.getDate().durationFrom(ar.getDate()), 2.0e-8);
        Assert.assertTrue(ar.getObservedValue()[0] - sr.getObservedValue()[0] >= 2.0 * xOffset);
        Assert.assertTrue(ar.getObservedValue()[0] - sr.getObservedValue()[0] <= 1.8 * xOffset);
    }
}
Also used : Context(org.orekit.estimation.Context) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) TurnAroundRange(org.orekit.estimation.measurements.TurnAroundRange) LofOffset(org.orekit.attitudes.LofOffset) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) TurnAroundRangeMeasurementCreator(org.orekit.estimation.measurements.TurnAroundRangeMeasurementCreator) Test(org.junit.Test)

Example 7 with ObservedMeasurement

use of org.orekit.estimation.measurements.ObservedMeasurement in project Orekit by CS-SI.

the class TropoModifierTest method testTurnAroundRangeTropoModifier.

@Test
public void testTurnAroundRangeTropoModifier() 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 turn-around measurements
    for (Map.Entry<GroundStation, GroundStation> entry : context.TARstations.entrySet()) {
        final GroundStation masterStation = entry.getKey();
        final GroundStation slaveStation = entry.getValue();
        masterStation.getEastOffsetDriver().setSelected(true);
        masterStation.getNorthOffsetDriver().setSelected(true);
        masterStation.getZenithOffsetDriver().setSelected(true);
        slaveStation.getEastOffsetDriver().setSelected(true);
        slaveStation.getNorthOffsetDriver().setSelected(true);
        slaveStation.getZenithOffsetDriver().setSelected(true);
    }
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new TurnAroundRangeMeasurementCreator(context), 1.0, 3.0, 300.0);
    propagator.setSlaveMode();
    final TurnAroundRangeTroposphericDelayModifier modifier = new TurnAroundRangeTroposphericDelayModifier(SaastamoinenModel.getStandardModel());
    for (final ObservedMeasurement<?> measurement : measurements) {
        final AbsoluteDate date = measurement.getDate();
        final SpacecraftState refState = propagator.propagate(date);
        TurnAroundRange turnAroundRange = (TurnAroundRange) measurement;
        EstimatedMeasurement<TurnAroundRange> evalNoMod = turnAroundRange.estimate(0, 0, new SpacecraftState[] { refState });
        // add modifier
        turnAroundRange.addModifier(modifier);
        // 
        EstimatedMeasurement<TurnAroundRange> eval = turnAroundRange.estimate(0, 0, new SpacecraftState[] { refState });
        final double diffMeters = eval.getEstimatedValue()[0] - evalNoMod.getEstimatedValue()[0];
        final double epsilon = 1e-6;
        Assert.assertTrue(Precision.compareTo(diffMeters, 12., epsilon) < 0);
        Assert.assertTrue(Precision.compareTo(diffMeters, 0., epsilon) > 0);
    }
}
Also used : Context(org.orekit.estimation.Context) GroundStation(org.orekit.estimation.measurements.GroundStation) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) TurnAroundRangeTroposphericDelayModifier(org.orekit.estimation.measurements.modifiers.TurnAroundRangeTroposphericDelayModifier) TurnAroundRange(org.orekit.estimation.measurements.TurnAroundRange) Map(java.util.Map) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) TurnAroundRangeMeasurementCreator(org.orekit.estimation.measurements.TurnAroundRangeMeasurementCreator) Test(org.junit.Test)

Example 8 with ObservedMeasurement

use of org.orekit.estimation.measurements.ObservedMeasurement in project Orekit by CS-SI.

the class TropoModifierTest method testAngularRadioRefractionModifier.

@Test
public void testAngularRadioRefractionModifier() 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 angular 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 AngularAzElMeasurementCreator(context), 1.0, 3.0, 300.0);
    propagator.setSlaveMode();
    for (final ObservedMeasurement<?> measurement : measurements) {
        final AbsoluteDate date = measurement.getDate();
        final SpacecraftState refState = propagator.propagate(date);
        AngularAzEl angular = (AngularAzEl) measurement;
        EstimatedMeasurement<AngularAzEl> evalNoMod = angular.estimate(0, 0, new SpacecraftState[] { refState });
        // get the altitude of the station (in kilometers)
        final double altitude = angular.getStation().getBaseFrame().getPoint().getAltitude() / 1000.;
        final AngularRadioRefractionModifier modifier = new AngularRadioRefractionModifier(new EarthITU453AtmosphereRefraction(altitude));
        // add modifier
        angular.addModifier(modifier);
        // 
        EstimatedMeasurement<AngularAzEl> eval = angular.estimate(0, 0, new SpacecraftState[] { refState });
        final double diffEl = MathUtils.normalizeAngle(eval.getEstimatedValue()[1], evalNoMod.getEstimatedValue()[1]) - evalNoMod.getEstimatedValue()[1];
        // TODO: check threshold
        Assert.assertEquals(0.0, diffEl, 1.0e-3);
    }
}
Also used : Context(org.orekit.estimation.Context) GroundStation(org.orekit.estimation.measurements.GroundStation) EarthITU453AtmosphereRefraction(org.orekit.models.earth.EarthITU453AtmosphereRefraction) AngularRadioRefractionModifier(org.orekit.estimation.measurements.modifiers.AngularRadioRefractionModifier) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) AngularAzElMeasurementCreator(org.orekit.estimation.measurements.AngularAzElMeasurementCreator) AngularAzEl(org.orekit.estimation.measurements.AngularAzEl) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) Test(org.junit.Test)

Example 9 with ObservedMeasurement

use of org.orekit.estimation.measurements.ObservedMeasurement in project Orekit by CS-SI.

the class BatchLSEstimatorTest method testKeplerRangeRate.

/**
 * Perfect range rate measurements with a perfect start
 * @throws OrekitException
 */
@Test
public void testKeplerRangeRate() 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, 1.0);
    // create perfect range rate measurements
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurements1 = EstimationTestUtils.createMeasurements(propagator, new RangeRateMeasurementCreator(context, false), 1.0, 3.0, 300.0);
    final List<ObservedMeasurement<?>> measurements = new ArrayList<ObservedMeasurement<?>>();
    measurements.addAll(measurements1);
    // create orbit estimator
    final BatchLSEstimator estimator = new BatchLSEstimator(new LevenbergMarquardtOptimizer(), propagatorBuilder);
    for (final ObservedMeasurement<?> rangerate : measurements) {
        estimator.addMeasurement(rangerate);
    }
    estimator.setParametersConvergenceThreshold(1.0e-3);
    estimator.setMaxIterations(10);
    estimator.setMaxEvaluations(20);
    EstimationTestUtils.checkFit(context, estimator, 2, 3, 0.0, 1.6e-2, 0.0, 3.4e-2, // we only have range rate...
    0.0, // we only have range rate...
    170.0, 0.0, 6.5e-2);
}
Also used : Context(org.orekit.estimation.Context) LevenbergMarquardtOptimizer(org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) BoundedPropagator(org.orekit.propagation.BoundedPropagator) Propagator(org.orekit.propagation.Propagator) ArrayList(java.util.ArrayList) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) RangeRateMeasurementCreator(org.orekit.estimation.measurements.RangeRateMeasurementCreator) Test(org.junit.Test)

Example 10 with ObservedMeasurement

use of org.orekit.estimation.measurements.ObservedMeasurement in project Orekit by CS-SI.

the class BatchLSEstimatorTest method testKeplerPV.

/**
 * Perfect PV measurements with a perfect start
 * @throws OrekitException
 */
@Test
public void testKeplerPV() 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, 1.0);
    // create perfect PV measurements
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurements = EstimationTestUtils.createMeasurements(propagator, new PVMeasurementCreator(), 0.0, 1.0, 300.0);
    // create orbit estimator
    final BatchLSEstimator estimator = new BatchLSEstimator(new LevenbergMarquardtOptimizer(), propagatorBuilder);
    for (final ObservedMeasurement<?> measurement : measurements) {
        estimator.addMeasurement(measurement);
    }
    estimator.setParametersConvergenceThreshold(1.0e-2);
    estimator.setMaxIterations(10);
    estimator.setMaxEvaluations(20);
    EstimationTestUtils.checkFit(context, estimator, 1, 4, 0.0, 2.2e-8, 0.0, 1.1e-7, 0.0, 1.4e-8, 0.0, 6.3e-12);
    RealMatrix normalizedCovariances = estimator.getOptimum().getCovariances(1.0e-10);
    RealMatrix physicalCovariances = estimator.getPhysicalCovariances(1.0e-10);
    Assert.assertEquals(6, normalizedCovariances.getRowDimension());
    Assert.assertEquals(6, normalizedCovariances.getColumnDimension());
    Assert.assertEquals(6, physicalCovariances.getRowDimension());
    Assert.assertEquals(6, physicalCovariances.getColumnDimension());
    Assert.assertEquals(0.00258, physicalCovariances.getEntry(0, 0), 1.0e-5);
}
Also used : Context(org.orekit.estimation.Context) LevenbergMarquardtOptimizer(org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer) RealMatrix(org.hipparchus.linear.RealMatrix) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) BoundedPropagator(org.orekit.propagation.BoundedPropagator) Propagator(org.orekit.propagation.Propagator) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) PVMeasurementCreator(org.orekit.estimation.measurements.PVMeasurementCreator) Test(org.junit.Test)

Aggregations

ObservedMeasurement (org.orekit.estimation.measurements.ObservedMeasurement)49 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)44 Test (org.junit.Test)41 Context (org.orekit.estimation.Context)40 Propagator (org.orekit.propagation.Propagator)40 Orbit (org.orekit.orbits.Orbit)20 AbsoluteDate (org.orekit.time.AbsoluteDate)19 ParameterDriversList (org.orekit.utils.ParameterDriversList)19 RangeMeasurementCreator (org.orekit.estimation.measurements.RangeMeasurementCreator)17 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)16 ParameterDriver (org.orekit.utils.ParameterDriver)15 Range (org.orekit.estimation.measurements.Range)14 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)13 RealMatrix (org.hipparchus.linear.RealMatrix)12 ArrayList (java.util.ArrayList)11 LevenbergMarquardtOptimizer (org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer)11 CartesianOrbit (org.orekit.orbits.CartesianOrbit)11 BoundedPropagator (org.orekit.propagation.BoundedPropagator)11 SpacecraftState (org.orekit.propagation.SpacecraftState)11 GroundStation (org.orekit.estimation.measurements.GroundStation)10