TLEKalmanModel.java

  1. /* Copyright 2002-2021 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.estimation.sequential;

  18. import java.util.List;

  19. import org.orekit.annotation.DefaultDataContext;
  20. import org.orekit.propagation.PropagationType;
  21. import org.orekit.propagation.Propagator;
  22. import org.orekit.propagation.SpacecraftState;
  23. import org.orekit.propagation.analytical.tle.TLEJacobiansMapper;
  24. import org.orekit.propagation.analytical.tle.TLEPartialDerivativesEquations;
  25. import org.orekit.propagation.analytical.tle.TLEPropagator;
  26. import org.orekit.propagation.conversion.OrbitDeterminationPropagatorBuilder;
  27. import org.orekit.propagation.integration.AbstractJacobiansMapper;
  28. import org.orekit.utils.ParameterDriversList;

  29. /** Class defining the process model dynamics to use with a {@link KalmanEstimator}.
  30.  * <p>
  31.  * This class is an adaption of the {@link KalmanModel} class
  32.  * but for the {@link TLEPropagator TLE propagator}.
  33.  * </p>
  34.  * @author Romain Gerbaud
  35.  * @author Maxime Journot
  36.  * @author Bryan Cazabonne
  37.  * @author Thomas Paulet
  38.  * @since 11.0
  39.  */
  40. public class TLEKalmanModel extends AbstractKalmanModel {

  41.     /** Kalman process model constructor (package private).
  42.      * @param propagatorBuilders propagators builders used to evaluate the orbits.
  43.      * @param covarianceMatricesProviders providers for covariance matrices
  44.      * @param estimatedMeasurementParameters measurement parameters to estimate
  45.      * @param measurementProcessNoiseMatrix provider for measurement process noise matrix
  46.      */
  47.     public TLEKalmanModel(final List<OrbitDeterminationPropagatorBuilder> propagatorBuilders,
  48.                           final List<CovarianceMatrixProvider> covarianceMatricesProviders,
  49.                           final ParameterDriversList estimatedMeasurementParameters,
  50.                           final CovarianceMatrixProvider measurementProcessNoiseMatrix) {
  51.         // call super constructor
  52.         super(propagatorBuilders, covarianceMatricesProviders, estimatedMeasurementParameters,
  53.               measurementProcessNoiseMatrix, new TLEJacobiansMapper[propagatorBuilders.size()]);
  54.     }

  55.     /** {@inheritDoc} */
  56.     @Override
  57.     @DefaultDataContext
  58.     protected void updateReferenceTrajectories(final Propagator[] propagators,
  59.                                                final PropagationType pType,
  60.                                                final PropagationType sType) {

  61.         // Update the reference trajectory propagator
  62.         setReferenceTrajectories(propagators);

  63.         // Jacobian mappers
  64.         final AbstractJacobiansMapper[] mappers = getMappers();

  65.         for (int k = 0; k < propagators.length; ++k) {
  66.             // Link the partial derivatives to this new propagator
  67.             final String equationName = KalmanEstimator.class.getName() + "-derivatives-" + k;
  68.             final TLEPartialDerivativesEquations pde = new TLEPartialDerivativesEquations(equationName, (TLEPropagator) getReferenceTrajectories()[k]);

  69.             // Reset the Jacobians
  70.             final SpacecraftState rawState = getReferenceTrajectories()[k].getInitialState();
  71.             final SpacecraftState stateWithDerivatives = pde.setInitialJacobians(rawState);
  72.             ((TLEPropagator) getReferenceTrajectories()[k]).resetInitialState(stateWithDerivatives);
  73.             mappers[k] = pde.getMapper();
  74.         }

  75.         // Update Jacobian mappers
  76.         setMappers(mappers);

  77.     }

  78.     /** {@inheritDoc} */
  79.     @Override
  80.     @DefaultDataContext
  81.     protected void analyticalDerivativeComputations(final AbstractJacobiansMapper mapper, final SpacecraftState state) {
  82.         ((TLEJacobiansMapper) mapper).analyticalDerivatives(state);
  83.     }

  84. }