Search in sources :

Example 11 with Propagator

use of org.orekit.propagation.Propagator 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 12 with Propagator

use of org.orekit.propagation.Propagator 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 13 with Propagator

use of org.orekit.propagation.Propagator 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)

Example 14 with Propagator

use of org.orekit.propagation.Propagator in project Orekit by CS-SI.

the class BatchLSEstimatorTest method testKeplerRangeAndRangeRate.

/**
 * Perfect range and range rate measurements with a perfect start
 * @throws OrekitException
 */
@Test
public void testKeplerRangeAndRangeRate() 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 measurements
    final Propagator propagator = EstimationTestUtils.createPropagator(context.initialOrbit, propagatorBuilder);
    final List<ObservedMeasurement<?>> measurementsRange = EstimationTestUtils.createMeasurements(propagator, new RangeMeasurementCreator(context), 1.0, 3.0, 300.0);
    final List<ObservedMeasurement<?>> measurementsRangeRate = EstimationTestUtils.createMeasurements(propagator, new RangeRateMeasurementCreator(context, false), 1.0, 3.0, 300.0);
    // concat measurements
    final List<ObservedMeasurement<?>> measurements = new ArrayList<ObservedMeasurement<?>>();
    measurements.addAll(measurementsRange);
    measurements.addAll(measurementsRangeRate);
    // create orbit estimator
    final BatchLSEstimator estimator = new BatchLSEstimator(new LevenbergMarquardtOptimizer(), propagatorBuilder);
    for (final ObservedMeasurement<?> meas : measurements) {
        estimator.addMeasurement(meas);
    }
    estimator.setParametersConvergenceThreshold(1.0e-3);
    estimator.setMaxIterations(10);
    estimator.setMaxEvaluations(20);
    // we have low correlation between the two types of measurement. We can expect a good estimate.
    EstimationTestUtils.checkFit(context, estimator, 1, 2, 0.0, 0.16, 0.0, 0.40, 0.0, 2.1e-3, 0.0, 8.1e-7);
}
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) RangeMeasurementCreator(org.orekit.estimation.measurements.RangeMeasurementCreator) InterSatellitesRangeMeasurementCreator(org.orekit.estimation.measurements.InterSatellitesRangeMeasurementCreator) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) RangeRateMeasurementCreator(org.orekit.estimation.measurements.RangeRateMeasurementCreator) Test(org.junit.Test)

Example 15 with Propagator

use of org.orekit.propagation.Propagator in project Orekit by CS-SI.

the class ModelTest method testBackwardPropagation.

@Test
public void testBackwardPropagation() throws OrekitException {
    final 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);
    final NumericalPropagatorBuilder[] builders = { propagatorBuilder };
    // 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);
    final ParameterDriversList estimatedMeasurementsParameters = new ParameterDriversList();
    for (ObservedMeasurement<?> measurement : measurements) {
        for (final ParameterDriver driver : measurement.getParametersDrivers()) {
            if (driver.isSelected()) {
                estimatedMeasurementsParameters.add(driver);
            }
        }
    }
    // create model
    final ModelObserver modelObserver = new ModelObserver() {

        /**
         * {@inheritDoc}
         */
        @Override
        public void modelCalled(final Orbit[] newOrbits, final Map<ObservedMeasurement<?>, EstimatedMeasurement<?>> newEvaluations) {
        // Do nothing here
        }
    };
    final Model model = new Model(builders, measurements, estimatedMeasurementsParameters, modelObserver);
    // Test forward propagation flag to false
    assertEquals(false, model.isForwardPropagation());
}
Also used : Context(org.orekit.estimation.Context) ParameterDriver(org.orekit.utils.ParameterDriver) ParameterDriversList(org.orekit.utils.ParameterDriversList) NumericalPropagatorBuilder(org.orekit.propagation.conversion.NumericalPropagatorBuilder) Propagator(org.orekit.propagation.Propagator) Map(java.util.Map) ObservedMeasurement(org.orekit.estimation.measurements.ObservedMeasurement) PVMeasurementCreator(org.orekit.estimation.measurements.PVMeasurementCreator) Test(org.junit.Test)

Aggregations

Propagator (org.orekit.propagation.Propagator)177 Test (org.junit.Test)141 SpacecraftState (org.orekit.propagation.SpacecraftState)92 AbsoluteDate (org.orekit.time.AbsoluteDate)90 Context (org.orekit.estimation.Context)67 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)67 ArrayList (java.util.ArrayList)62 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)58 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)51 Orbit (org.orekit.orbits.Orbit)46 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)41 ObservedMeasurement (org.orekit.estimation.measurements.ObservedMeasurement)40 Event (org.orekit.propagation.events.handlers.RecordAndContinue.Event)38 StopOnEvent (org.orekit.propagation.events.handlers.StopOnEvent)38 OrekitException (org.orekit.errors.OrekitException)30 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)29 GeodeticPoint (org.orekit.bodies.GeodeticPoint)28 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)28 PVCoordinates (org.orekit.utils.PVCoordinates)26 ParameterDriver (org.orekit.utils.ParameterDriver)23