Commit 5d9dd102 authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Prepared orbit determination to work with analytical orbit propagators.

parent f6ec913d
/* Copyright 2002-2022 CS GROUP
* Licensed to CS GROUP (CS) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* CS licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.orekit.estimation.leastsquares;
import java.util.List;
import org.orekit.estimation.measurements.ObservedMeasurement;
import org.orekit.orbits.Orbit;
import org.orekit.propagation.MatricesHarvester;
import org.orekit.propagation.Propagator;
import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
import org.orekit.propagation.integration.AbstractJacobiansMapper;
import org.orekit.utils.ParameterDriversList;
/**
* Bridge between {@link ObservedMeasurement measurements} and {@link
* org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresProblem
* least squares problems}.
* @author Luc Maisonobe
* @author Bryan Cazabonne
* @author Thomas Paulet
* @since 11.1
*/
public class AnalyticalBatchLSModel extends AbstractBatchLSModel {
/** Name of the State Transition Matrix state. */
private static final String STM_NAME = AnalyticalBatchLSModel.class.getName() + "-derivatives";
/** Simple constructor.
* @param propagatorBuilders builders to use for propagation
* @param measurements measurements
* @param estimatedMeasurementsParameters estimated measurements parameters
* @param observer observer to be notified at model calls
*/
public AnalyticalBatchLSModel(final OrbitDeterminationPropagatorBuilder[] propagatorBuilders,
final List<ObservedMeasurement<?>> measurements,
final ParameterDriversList estimatedMeasurementsParameters,
final ModelObserver observer) {
// call super constructor
super(propagatorBuilders, measurements, estimatedMeasurementsParameters, observer);
}
/** {@inheritDoc} */
@Override
protected MatricesHarvester configureHarvester(final Propagator propagator) {
return propagator.setupMatricesComputation(STM_NAME, null, null);
}
/** {@inheritDoc} */
@Override
@Deprecated
protected AbstractJacobiansMapper configureDerivatives(final Propagator propagators) {
// This deprecated method is replaced by configureHarvester() method
// Therefore there is no risk to return a null value here
return null;
}
/** {@inheritDoc} */
@Override
protected Orbit configureOrbits(final MatricesHarvester harvester,
final Propagator propagator) {
return propagator.getInitialState().getOrbit();
}
}
......@@ -39,8 +39,9 @@ import org.orekit.utils.ParameterDriversList;
* @author Bryan Cazabonne
* @author Thomas Paulet
* @since 11.0
*
* @deprecated as of 11.1, replaced by {@link AnalyticalBatchLSModel}
*/
@Deprecated
public class TLEBatchLSModel extends AbstractBatchLSModel {
/** Name of the State Transition Matrix state. */
......
......@@ -23,7 +23,6 @@ import org.orekit.propagation.PropagationType;
import org.orekit.propagation.Propagator;
import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
import org.orekit.propagation.numerical.JacobiansMapper;
import org.orekit.propagation.numerical.NumericalPropagator;
import org.orekit.utils.ParameterDriversList;
/** Class defining the process model dynamics to use with a {@link KalmanEstimator}.
......@@ -63,7 +62,7 @@ public class KalmanModel extends AbstractKalmanModel {
for (int k = 0; k < propagators.length; ++k) {
// Link the partial derivatives to this new propagator
final String equationName = KalmanEstimator.class.getName() + "-derivatives-" + k;
harvesters[k] = ((NumericalPropagator) getReferenceTrajectories()[k]).setupMatricesComputation(equationName, null, null);
harvesters[k] = getReferenceTrajectories()[k].setupMatricesComputation(equationName, null, null);
}
// Update Jacobian harvesters
......
......@@ -37,7 +37,9 @@ import org.orekit.utils.ParameterDriversList;
* @author Bryan Cazabonne
* @author Thomas Paulet
* @since 11.0
* @deprecated as of 11.1, replaced by {@link KalmanModel}
*/
@Deprecated
public class TLEKalmanModel extends AbstractKalmanModel {
/** Kalman process model constructor (package private).
......
......@@ -22,12 +22,12 @@ import org.orekit.annotation.DefaultDataContext;
import org.orekit.attitudes.InertialProvider;
import org.orekit.data.DataContext;
import org.orekit.estimation.leastsquares.AbstractBatchLSModel;
import org.orekit.estimation.leastsquares.AnalyticalBatchLSModel;
import org.orekit.estimation.leastsquares.ModelObserver;
import org.orekit.estimation.leastsquares.TLEBatchLSModel;
import org.orekit.estimation.measurements.ObservedMeasurement;
import org.orekit.estimation.sequential.AbstractKalmanModel;
import org.orekit.estimation.sequential.CovarianceMatrixProvider;
import org.orekit.estimation.sequential.TLEKalmanModel;
import org.orekit.estimation.sequential.KalmanModel;
import org.orekit.frames.Frame;
import org.orekit.orbits.Orbit;
import org.orekit.orbits.PositionAngle;
......@@ -220,7 +220,7 @@ public class TLEPropagatorBuilder extends AbstractPropagatorBuilder implements O
final List<ObservedMeasurement<?>> measurements,
final ParameterDriversList estimatedMeasurementsParameters,
final ModelObserver observer) {
return new TLEBatchLSModel(builders, measurements, estimatedMeasurementsParameters, observer);
return new AnalyticalBatchLSModel(builders, measurements, estimatedMeasurementsParameters, observer);
}
@Override
......@@ -229,7 +229,7 @@ public class TLEPropagatorBuilder extends AbstractPropagatorBuilder implements O
final List<CovarianceMatrixProvider> covarianceMatricesProviders,
final ParameterDriversList estimatedMeasurementsParameters,
final CovarianceMatrixProvider measurementProcessNoiseMatrix) {
return new TLEKalmanModel(propagatorBuilders, covarianceMatricesProviders, estimatedMeasurementsParameters, measurementProcessNoiseMatrix);
return new KalmanModel(propagatorBuilders, covarianceMatricesProviders, estimatedMeasurementsParameters, measurementProcessNoiseMatrix);
}
}
......@@ -41,7 +41,7 @@ import org.orekit.propagation.conversion.TLEPropagatorBuilder;
import org.orekit.utils.ParameterDriver;
import org.orekit.utils.ParameterDriversList;
public class TLEBatchLSModelTest {
public class AnalyticalBatchLSModelTest {
@Test
public void testPerfectValue() {
......@@ -87,8 +87,7 @@ public class TLEBatchLSModelTest {
Assert.assertEquals(measurements.size(), newEvaluations.size());
}
};
final TLEBatchLSModel model = new TLEBatchLSModel(builders, measurements, estimatedMeasurementsParameters,
modelObserver);
final AnalyticalBatchLSModel model = new AnalyticalBatchLSModel(builders, measurements, estimatedMeasurementsParameters, modelObserver);
model.setIterationsCounter(new Incrementor(100));
model.setEvaluationsCounter(new Incrementor(100));
......@@ -149,8 +148,7 @@ public class TLEBatchLSModelTest {
// Do nothing here
}
};
final TLEBatchLSModel model = new TLEBatchLSModel(builders, measurements, estimatedMeasurementsParameters,
modelObserver);
final AnalyticalBatchLSModel model = new AnalyticalBatchLSModel(builders, measurements, estimatedMeasurementsParameters, modelObserver);
// Test forward propagation flag to false
assertEquals(false, model.isForwardPropagation());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment