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);
}
}
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);
}
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);
}
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);
}
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());
}
Aggregations